Skip to content

[remove] migrate Wiki, Recipe, Policy pages to independent #88

Merged
TechQuery merged 2 commits into
mainfrom
migrate-wiki-pages
Jul 15, 2026
Merged

[remove] migrate Wiki, Recipe, Policy pages to independent #88
TechQuery merged 2 commits into
mainfrom
migrate-wiki-pages

Conversation

@TechQuery

@TechQuery TechQuery commented Jul 12, 2026

Copy link
Copy Markdown
Member

PR-88 PR-88 PR-88 Powered by Pull Request Badge

  1. [remove] migrate Wiki, Recipe, Policy pages to independent (fix 提升【开源市集】官网 SSG 构建速度 Wiki#2)
  2. [refactor] skip SSG detail pages to speed up Building time
  3. [fix] setup Next.js SWC patch with PNPM 10

Summary by CodeRabbit

  • 功能变更
    • 移除了政策、食谱与 Wiki 的索引页面,以及政策/食谱/Wiki 的详情页面。
    • 文档内容的目录浏览、正文展示、元信息展示与“编辑/查看原文”入口随页面移除而不再提供。
  • 构建/发布
    • 在持续集成环境下,静态构建行为调整以减少构建开销。
  • 影响
    • 访问上述页面路径将不再显示原有文档内容或目录。

Copilot AI review requested due to automatic review settings July 12, 2026 00:43
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

删除 policy、recipe 和 wiki 的索引及动态页面,连同静态路径生成、静态属性获取、内容解析、树形目录和页面渲染实现一并移除;同时新增统一的 SSG 跳过构建封装,并将 NGO 页面迁移至该封装。

Changes

内容页面路由移除

Layer / File(s) Summary
Policy、Recipe 与 Wiki 页面移除
pages/policy/*, pages/recipe/*, pages/wiki/*
移除页面默认导出、Pages Router 数据获取、Markdown 解析、Wiki 节点加载、目录树和文档渲染逻辑。

SSG 构建策略与 API 工具收缩

Layer / File(s) Summary
统一 SSG 跳过与失败处理
pages/api/SSG.ts, pages/NGO/[year]/index.tsx, pages/NGO/[year]/landscape.tsx, models/configuration.ts
新增 skipBuilding,依据 CI 跳过静态构建,并统一处理错误、notFoundrevalidate;两个 NGO 页面改用该封装。
API 内容工具导出清理
pages/api/core.ts
移除 Markdown 匹配、Front Matter 解析、页面列表生成、树遍历和 Markdown 文件过滤相关导出及依赖,保留 JWT 与 Koa 中间件能力。

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题与本次将 Wiki、Recipe、Policy 等页面迁移/移除到独立项目的主要变更一致,能概括核心方向。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch migrate-wiki-pages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dosubot

dosubot Bot commented Jul 12, 2026

Copy link
Copy Markdown

📄 Knowledge review

✏️ Documentation updates

1 page was updated by changes in this PR.

Page Library Status
Open Source Policy and Governance Open Source Bazaar's Space ✅ Updated
📝 Open Source Policy and Governance — changes
@@ -1,8 +1,8 @@
-The Open Source Bazaar project maintains a comprehensive framework for open source policy, licensing, and community standards, with clear documentation and integration into the project’s navigation and contribution workflows.
+The Open Source Bazaar project maintains a comprehensive framework for open source policy, licensing, and community standards, with clear documentation and integration into the project's navigation and contribution workflows.
 
 Open Source Policies and Documentation
 
-Open source policies are documented as Markdown files in a wiki-like structure. These documents are dynamically rendered and organized in a tree view on the `/policy` page of the project website, allowing users to browse by topic and hierarchy. Each policy page displays metadata such as category, issuing organization, validity status, and creation/publication dates using badges and labels for clarity. The policy pages include direct links to the source Markdown files on GitHub, enabling users to view, edit, or contribute to the policy documentation. A dedicated button on the policy page links to the GitHub repository (`fpsig/open-source-policy`), supporting an open contribution model for policy content. The policy section is fully integrated into the site’s navigation and internationalization context, ensuring discoverability and accessibility for all users [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/pages/policy/index.tsx) [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/pages/policy/[...slug].tsx).
+Open source policies are documented as Markdown files sourced from the `fpsig/open-source-policy` GitHub repository. As of PR #88, the policy content has been migrated to an independent service at `https://wiki.fcc-cd.dev/policy`. The main Open Source Bazaar website (`Open-Source-Bazaar.github.io`) now redirects all `/policy` routes to this external wiki service via permanent redirects configured in `next.config.ts`. The original Next.js pages (`pages/policy/index.tsx` and `pages/policy/[...slug].tsx`) that previously rendered policy content directly on the main site have been removed as part of this migration. Policy content remains accessible through the site's navigation, but users are directed to the independent wiki service for viewing and contributing to policy documentation.
 
 Licensing
 
@@ -10,14 +10,14 @@
 
 Code of Conduct
 
-The project’s Code of Conduct, titled “行为规范” (Behavior Code), is versioned and last updated in September 2025. It applies to all community interactions, including online groups (WeChat, Feishu), meetings, events, GitHub repositories, and other official channels. The code emphasizes legal compliance, anti-harassment, respectful communication, privacy protection, content quality, and community participation. Enforcement mechanisms are clearly defined: community managers and administrators can issue warnings, restrict permissions, or permanently remove violators. The Code of Conduct is adapted from established open source community guidelines such as freeCodeCamp and Contributor Covenant 2.0, ensuring alignment with best practices. The document is accessible from the main navigation menu under the “about” section as `/article/code-of-conduct` [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/pages/article/code-of-conduct.mdx) [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/components/Navigator/MainNavigator.tsx).
+The project's Code of Conduct, titled "行为规范" (Behavior Code), is versioned and last updated in September 2025. It applies to all community interactions, including online groups (WeChat, Feishu), meetings, events, GitHub repositories, and other official channels. The code emphasizes legal compliance, anti-harassment, respectful communication, privacy protection, content quality, and community participation. Enforcement mechanisms are clearly defined: community managers and administrators can issue warnings, restrict permissions, or permanently remove violators. The Code of Conduct is adapted from established open source community guidelines such as freeCodeCamp and Contributor Covenant 2.0, ensuring alignment with best practices. The document is accessible from the main navigation menu under the "about" section as `/article/code-of-conduct` [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/pages/article/code-of-conduct.mdx) [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/components/Navigator/MainNavigator.tsx).
 
 Navigation Integration
 
-The main navigation menu includes direct links to the wiki and policy sections, as well as the Code of Conduct, making these resources easily accessible. The “wiki” section links to both `/wiki` and `/policy`, while the “about” section includes a link to the Code of Conduct. Breadcrumb navigation and contextual links further enhance discoverability and user experience [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/components/Navigator/MainNavigator.tsx).
+The main navigation menu includes direct links to the wiki and policy sections, as well as the Code of Conduct, making these resources easily accessible. The "wiki" section links to both `/wiki` and `/policy`, while the "about" section includes a link to the Code of Conduct. Breadcrumb navigation and contextual links further enhance discoverability and user experience [[source]](https://github.com/Open-Source-Bazaar/Open-Source-Bazaar.github.io/blob/f5df98635f7a8bdab44cded44633ecbc3145a73f/components/Navigator/MainNavigator.tsx).
 
 Governance Model
 
-No specific information about the project’s governance model (such as meritocratic, committee-based, or benevolent dictator models) was found in the available documentation or committee meeting records. Governance models are typically described in dedicated documents (e.g., `governance.md`), committee notes, or wiki sections. If clarification is needed, maintainers or contributors are encouraged to document the governance structure in a prominent location within the wiki or project documentation.
+No specific information about the project's governance model (such as meritocratic, committee-based, or benevolent dictator models) was found in the available documentation or committee meeting records. Governance models are typically described in dedicated documents (e.g., `governance.md`), committee notes, or wiki sections. If clarification is needed, maintainers or contributors are encouraged to document the governance structure in a prominent location within the wiki or project documentation.
 
 For further details or to contribute to policy and governance documentation, refer to the policy section and the linked GitHub repositories in the project navigation.

Leave Feedback Ask Dosu about Open-Source-Bazaar.github.io Add Dosu to your team

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the built-in Next.js page routes for Wiki/Policy/Recipe content (presumably because these sections are being migrated to independent destinations) and adjusts PNPM configuration to apply a patched Next.js dependency under PNPM 10+.

Changes:

  • Removed pages/wiki/*, pages/policy/*, and pages/recipe/* page implementations.
  • Moved patchedDependencies configuration from package.json into pnpm-workspace.yaml.
  • Regenerated pnpm-lock.yaml to reflect the patched Next.js dependency hash/metadata.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-workspace.yaml Adds patchedDependencies so PNPM applies the local patch for next@16.2.10.
pnpm-lock.yaml Updates patch hash/lock metadata for the patched Next.js dependency and related packages.
pages/wiki/index.tsx Deletes the Wiki index page route.
pages/wiki/[node_token].tsx Deletes the Wiki document page route.
pages/recipe/index.tsx Deletes the Recipe index page route.
pages/recipe/[...slug].tsx Deletes the Recipe markdown-rendering page route.
pages/policy/index.tsx Deletes the Policy index page route.
pages/policy/[...slug].tsx Deletes the Policy markdown-rendering page route.
package.json Removes pnpm.patchedDependencies config (now managed via workspace YAML).
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread package.json
@TechQuery TechQuery added the enhancement Some improvements label Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pages/api/SSG.ts`:
- Around line 14-24: Update the static-generation handler around rawHandler and
CI: remove the try/catch so errors from rawHandler(context) bubble naturally,
and replace the truthiness check on CI with an explicit string comparison that
only skips generation when CI is exactly "true". Preserve the existing fallback
result for the intended CI path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: facfe5ed-2697-4a84-a858-64c556b56769

📥 Commits

Reviewing files that changed from the base of the PR and between 2c281f7 and 03a81f7.

⛔ Files ignored due to path filters (4)
  • next.config.ts is excluded by none and included by none
  • package.json is excluded by none and included by none
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml and included by none
  • pnpm-workspace.yaml is excluded by none and included by none
📒 Files selected for processing (5)
  • models/configuration.ts
  • pages/NGO/[year]/index.tsx
  • pages/NGO/[year]/landscape.tsx
  • pages/api/SSG.ts
  • pages/api/core.ts
💤 Files with no reviewable changes (1)
  • pages/api/core.ts

Comment thread pages/api/SSG.ts
Comment on lines +14 to +24
const fallback: GetStaticPropsResult<any> = { notFound: true, revalidate };

if (CI) return fallback;

try {
return await rawHandler(context);
} catch (error) {
console.error(error);

return fallback;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

遵循规范让错误自然冒泡,并严谨判断 CI 环境变量

根据项目编码规范要求:“For static generation, allow errors to bubble naturally (do not swallow errors)”,静态数据获取阶段不应该使用 try/catch 吞没错误。直接捕获错误并返回 404 状态会导致 CI/CD 环境下无法正确暴露构建失败,并且可能会导致暂时的接口异常被作为 404 页面缓存下来。

此外,环境变量 CI 解析后为字符串类型。如果在运行命令时显式设定了 CI=false,原先的 if (CI) 依然会判定为真并意外跳过构建。建议采用严格的字符串值比对。

💡 建议的修复方案

移除多余的类型和错误捕获代码,让错误在构建阶段自然向上冒泡:

-    const fallback: GetStaticPropsResult<any> = { notFound: true, revalidate };
-
-    if (CI) return fallback;
-
-    try {
-      return await rawHandler(context);
-    } catch (error) {
-      console.error(error);
-
-      return fallback;
-    }
+    if (String(CI).toLowerCase() === 'true') {
+      return { notFound: true, revalidate };
+    }
+
+    return await rawHandler(context);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const fallback: GetStaticPropsResult<any> = { notFound: true, revalidate };
if (CI) return fallback;
try {
return await rawHandler(context);
} catch (error) {
console.error(error);
return fallback;
}
if (String(CI).toLowerCase() === 'true') {
return { notFound: true, revalidate };
}
return await rawHandler(context);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/api/SSG.ts` around lines 14 - 24, Update the static-generation handler
around rawHandler and CI: remove the try/catch so errors from
rawHandler(context) bubble naturally, and replace the truthiness check on CI
with an explicit string comparison that only skips generation when CI is exactly
"true". Preserve the existing fallback result for the intended CI path.

Source: Coding guidelines

@TechQuery TechQuery merged commit 2fe4e21 into main Jul 15, 2026
6 checks passed
@TechQuery TechQuery deleted the migrate-wiki-pages branch July 15, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Some improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

提升【开源市集】官网 SSG 构建速度

2 participants