Skip to content

Conversation

@simonguo
Copy link
Owner

This pull request introduces a major v3.0.0 refactor and modernization of the React Code View project, reorganizing the codebase into a PNPM monorepo, updating CI/CD workflows, enforcing consistent linting and formatting, and providing comprehensive documentation and migration guidance. The update brings breaking changes to package structure, build tool integration, and minimum requirements, while improving developer experience and maintainability.

Major v3.0.0 Refactor and Monorepo Migration:

  • Introduced a Changesets configuration for versioning and changelogs, and documented all breaking changes and migration steps in a new changeset markdown file. [1] [2]
  • Rewrote the README.md to provide clear installation, usage, migration, and contribution instructions, reflecting the new package structure and build tool support.

Monorepo and Tooling Modernization:

  • Adopted PNPM and Turbo for monorepo management, updated all GitHub Actions workflows to use Node 18+, PNPM, and improved caching; CI now type-checks, builds, and tests all packages, and docs are deployed from docs/dist. [1] [2] [3]
  • Added ESLint and Prettier configurations to enforce code style and linting across the codebase. [1] [2]

Breaking Changes and Cleanup:

  • Removed legacy and now-obsolete test files for CodeEditor, CodeView, and ErrorBoundary, reflecting the new architecture and test approach. [1] [2] [3]

See the included migration guide in the README and changeset for full details on breaking changes and how to upgrade.

- Hook: stabilize useCodeExecution (refs, stable execute, updateCode alias)

- Tests: fix TypeScript matchers and marked renderer signature; remove unused vars

- Docs: README requirements, hook example, CI/CD notes

- CI: Node 18 + PNPM, cache; turbo scripts; gh-pages publish docs/dist

- Publish: Changesets + npm provenance (OIDC), remove NODE_AUTH_TOKEN

- Misc: align workspace configs
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a major v3.0.0 refactor that modernizes the React Code View project by migrating to a PNPM monorepo structure, updating build tooling to use modern solutions (Vite, Turbo, tsup), replacing highlight.js with Shiki for syntax highlighting, and upgrading from CodeMirror 5 to CodeMirror 6. The changes include comprehensive documentation, migration guides, and support for multiple build tools through unplugin.

Key Changes

  • Migrated from single package to PNPM monorepo with 4 packages: @react-code-view/core, @react-code-view/react, @react-code-view/unplugin, and react-code-view
  • Replaced legacy webpack-md-loader with universal unplugin supporting Webpack, Vite, Rollup, esbuild, and Rspack
  • Modernized syntax highlighting by switching from highlight.js to Shiki, and editor from CodeMirror 5 to CodeMirror 6
  • Updated minimum Node version to 18+ and added comprehensive TypeScript project references

Reviewed changes

Copilot reviewed 172 out of 179 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Root package.json converted to monorepo configuration with PNPM and Turbo
pnpm-workspace.yaml Workspace configuration for packages and examples
turbo.json Turbo build orchestration configuration
tsconfig.json, tsconfig.base.json TypeScript project references for monorepo
vite.config.ts Vite configuration for documentation site
packages/core/* New core package with Shiki-based markdown transformation
packages/react/* React components with CodeMirror 6 and updated architecture
packages/unplugin/* Universal build tool plugin package
packages/react-code-view/* Main package re-exporting from other packages
examples/* Example projects for Vite, Webpack, Rollup, and esbuild
webpack-md-loader/* Removed legacy webpack loader
src/* Removed old source files (migrated to packages/)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


export const OverviewPage: React.FC<OverviewPageProps> = ({ theme }) => {
const isDark = theme === 'rcv-theme-dark';
const codeTheme = isDark ? 'github-dark' : 'github-light';
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

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

Unused variable codeTheme.

Copilot uses AI. Check for mistakes.
@simonguo simonguo merged commit 308881b into main Dec 29, 2025
2 checks passed
@simonguo simonguo deleted the release/v3.0.0-major-refactor branch December 29, 2025 08:50
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.

2 participants