[remove] migrate Wiki, Recipe, Policy pages to independent #88
Conversation
[fix] setup Next.js SWC patch with PNPM 10
📝 WalkthroughWalkthrough删除 policy、recipe 和 wiki 的索引及动态页面,连同静态路径生成、静态属性获取、内容解析、树形目录和页面渲染实现一并移除;同时新增统一的 SSG 跳过构建封装,并将 NGO 页面迁移至该封装。 Changes内容页面路由移除
SSG 构建策略与 API 工具收缩
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
📄 Knowledge review✏️ Documentation updates1 page was updated by changes in this PR.
📝 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. |
There was a problem hiding this comment.
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/*, andpages/recipe/*page implementations. - Moved
patchedDependenciesconfiguration frompackage.jsonintopnpm-workspace.yaml. - Regenerated
pnpm-lock.yamlto 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
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (4)
next.config.tsis excluded by none and included by nonepackage.jsonis excluded by none and included by nonepnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yamland included by nonepnpm-workspace.yamlis excluded by none and included by none
📒 Files selected for processing (5)
models/configuration.tspages/NGO/[year]/index.tsxpages/NGO/[year]/landscape.tsxpages/api/SSG.tspages/api/core.ts
💤 Files with no reviewable changes (1)
- pages/api/core.ts
| const fallback: GetStaticPropsResult<any> = { notFound: true, revalidate }; | ||
|
|
||
| if (CI) return fallback; | ||
|
|
||
| try { | ||
| return await rawHandler(context); | ||
| } catch (error) { | ||
| console.error(error); | ||
|
|
||
| return fallback; | ||
| } |
There was a problem hiding this comment.
🎯 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.
| 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
Summary by CodeRabbit