Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: monorepo #174

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

feat: monorepo #174

wants to merge 6 commits into from

Conversation

yuguaa
Copy link

@yuguaa yuguaa commented Mar 18, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new monorepo structure with dedicated packages for documentation, build utilities, core components, and an interactive demo environment.
    • Added new package for @ant-design-x-vue/docs and @ant-design-x-vue/components.
    • Created new configuration files for TypeScript and build processes to enhance project organization.
  • Refactor

    • Streamlined module resolution and dependency management, ensuring core features are more easily accessible.
    • Restructured TypeScript configurations and paths to better align with the new package structure.
  • Chores

    • Updated ignore settings and revamped build and type configurations to improve overall project consistency.
    • Modified package management settings and scripts for improved development workflow.

Copy link
Contributor

coderabbitai bot commented Mar 18, 2025

Walkthrough

The pull request introduces significant modifications across various configuration and package files within the repository. It reorganizes the .gitignore entries, comments out alias configurations and updates import paths in VitePress plugins. New package definitions and TypeScript configurations are added for documentation, build utilities, and core packages. The main package.json reflects a transition to a monorepo structure, incorporating workspace management, updated scripts, and restructured dependencies.

Changes

File(s) Change Summary
.gitignore Added new ignore entries (Dependencies, Package Manager, Bundle, local env files) and reorganized existing entries.
docs/.vitepress/config.mts Commented out alias configuration for ant-design-x-vue.
docs/.vitepress/plugins/demo.ts, docs/.vitepress/plugins/markdown-transform.ts Updated import paths for docRoot to use the absolute path from @ant-design-x-vue/build-utils.
docs/package.json Introduced new package file for @ant-design-x-vue/docs with VitePress scripts and dependency definitions.
docs/tsconfig.json Added a new TypeScript configuration file for documentation.
internal/build-utils/build.config.ts Added new build configuration using unbuild for project build settings.
internal/build-utils/package.json Introduced new package file for @ant-design-x-vue/build-utils with export mappings and development dependencies.
package.json Renamed package to ant-design-x-vue-monorepo, updated version, added workspaces, revised scripts, and restructured dependencies.
packages/ant-design-x-vue/package.json Created new package definition for ant-design-x-vue with metadata, entry points, and peer dependencies.
packages/ant-design-x-vue/src/index.ts Added new file exporting the public API from @ant-design-x-vue/components.
packages/ant-design-x-vue/vite.config.mts Reordered import statements and updated globals syntax in the configuration.
packages/components/package.json Added new package file for @ant-design-x-vue/components with scripts and a peer dependency on Vue.
play/package.json Renamed package to @ant-design-x-vue/play and updated dependency references.
play/vite.config.ts Removed the unused path import and alias configuration to simplify the setup.
pnpm-workspace.yaml Updated workspace entries; added docs, internal/*, and packages/* to expand the project scope.
tsconfig.build.json Updated path mappings, include/exclude settings, and the declaration output directory to reflect the new structure.
tsconfig.json Modified path mappings and inclusion settings to align with the project’s restructured directories.

Suggested labels

project

Poem

I'm a rabbit with code in my paws,
Hopping through changes without a pause.
New paths and packages make my heart skip a beat,
In a monorepo garden, everything's neat.
With a twitch of my nose and a joyful leap,
I nibble on code secrets that I'll forever keep.

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

docs/.vitepress/plugins/demo.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Failed to load parser 'vue-eslint-parser' declared in '.eslintrc.js': Cannot find module 'vue-eslint-parser'
Require stack:

  • /.eslintrc.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
internal/build-utils/build.config.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Failed to load parser 'vue-eslint-parser' declared in '.eslintrc.js': Cannot find module 'vue-eslint-parser'
Require stack:

  • /.eslintrc.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
packages/ant-design-x-vue/src/index.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Failed to load parser 'vue-eslint-parser' declared in '.eslintrc.js': Cannot find module 'vue-eslint-parser'
Require stack:

  • /.eslintrc.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.resolve (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
    at ConfigArrayFactory._loadParser (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
    at _normalizeObjectConfigDataBody.next ()
    at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
    at _normalizeObjectConfigData.next ()
    at ConfigArrayFactory.loadInDirectory (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
  • 2 others

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for antd-design-x-vue failed. Why did it fail? →

Name Link
🔨 Latest commit 138d72d
🔍 Latest deploy log https://app.netlify.com/sites/antd-design-x-vue/deploys/67dd90cc5015790008d77ce9

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (9)
package.json (2)

10-22: Update of Build and Utility Scripts

The scripts have been modernized to leverage pnpm for workspace filtering and cross-directory commands. A couple of points to note:

  • The "postinstall": "pnpm stub" and "stub": "pnpm run -r --parallel stub" commands appear to be placeholders or utility stubs. Verify that these commands meet your intended setup or consider adding a brief comment for clarity.

28-34: Centralized Dependency Management

Defining shared dependencies at the workspace root is appropriate. If many sub-packages rely on these libraries, you might explore hoisting common dependencies to avoid version conflicts and duplication.

docs/.vitepress/plugins/demo.ts (1)

3-3: Absolute Import for docRoot Updated.
The import for docRoot now uses an absolute path (@ant-design-x-vue/build-utils) instead of a relative one. This improves maintainability and clarity regarding the module source. Make sure that the package alias is correctly configured in both the monorepo’s package management and the TypeScript path mappings.

docs/tsconfig.json (1)

1-23: New TypeScript Configuration File Added.
This new tsconfig.json defines essential compiler options (ESNext target, module resolution, strict mode, etc.) and provides custom path mappings (e.g. mapping "ant-design-x-vue" to "../packages/ant-design-x-vue" and "~/*" to ".vitepress/vitepress/*"). Please verify that these mappings correctly reflect the monorepo structure and include all necessary directories for proper compilation.

play/package.json (2)

2-2: Package Name Renaming.
The package name has been updated to "@ant-design-x-vue/play", which aligns with the monorepo’s naming conventions. Ensure that downstream dependencies and internal documentation reference the new name.


12-14: Workspace Dependency Update.
The dependency for "ant-design-x-vue" now uses "workspace:*" instead of a local file reference. Confirm that the workspace tooling supports this syntax and that the dependency resolves correctly within your monorepo.

docs/package.json (1)

1-22: Documentation Package Configuration Introduced.
This new package.json for @ant-design-x-vue/docs outlines development scripts for VitePress and specifies both dependencies and devDependencies (including a workspace reference for @ant-design-x-vue/build-utils). Ensure that these dependencies resolve as intended in the monorepo setup and that the versioning meets the project’s requirements.

docs/.vitepress/config.mts (1)

21-24: Alias Configuration for ant-design-x-vue Commented Out.
The alias configuration for resolving ant-design-x-vue (mapping it to a local source directory) has been commented out. Confirm that the removal of this alias does not affect module resolution in your build process. If it is no longer needed, consider removing the commented code to keep the configuration clean.

packages/ant-design-x-vue/package.json (1)

15-17: Enhance the Repository Field for Better Traceability

Currently, the repository field only specifies the type. Including a repository URL will provide a direct link to the source code. Consider updating as follows:

 "repository": {
-  "type": "git"
+  "type": "git",
+  "url": "https://github.com/your-repo.git"
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0dce89a and cff276c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • .gitignore (1 hunks)
  • docs/.vitepress/config.mts (1 hunks)
  • docs/.vitepress/plugins/demo.ts (1 hunks)
  • docs/.vitepress/plugins/markdown-transform.ts (1 hunks)
  • docs/package.json (1 hunks)
  • docs/tsconfig.json (1 hunks)
  • internal/build-utils/build.config.ts (1 hunks)
  • internal/build-utils/package.json (1 hunks)
  • package.json (2 hunks)
  • packages/ant-design-x-vue/package.json (1 hunks)
  • packages/ant-design-x-vue/src/index.ts (1 hunks)
  • packages/ant-design-x-vue/vite.config.mts (2 hunks)
  • packages/components/package.json (1 hunks)
  • play/package.json (2 hunks)
  • play/vite.config.ts (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • tsconfig.build.json (2 hunks)
  • tsconfig.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Redirect rules - antd-design-x-vue
  • GitHub Check: Header rules - antd-design-x-vue
  • GitHub Check: Pages changed - antd-design-x-vue
  • GitHub Check: Pages changed - antd-design-x-vue
🔇 Additional comments (22)
pnpm-workspace.yaml (1)

2-5: Workspace Configuration Update Validity

The updated workspace entries are set properly. Changing "play" to play is acceptable since quoting isn’t necessary here, and the new entries—docs, internal/*, and packages/*—correctly expand the monorepo to include the additional directories. Make sure these align with any internal naming conventions if they exist.

.gitignore (1)

1-23: Enhanced .gitignore Organization

The file has been restructured into clear sections (Dependencies, System Files, Package Manager, Bundle, and local env files). New entries like dist, coverage, .pnpm-debug.log*, and the additional temporary directories (e.g. .dumi/tmp) are appropriately added to ignore build outputs and logs typical in a monorepo setting.

package.json (3)

2-9: Monorepo Identification and Workspace Setup

Renaming the package to "ant-design-x-vue-monorepo" and marking it as private clearly indicates the intent for a monorepo structure. The "workspaces" field now properly includes directories for sub-packages and projects.


77-80: Peer Dependencies Specification

The peer dependency constraints (for ant-design-vue and vue) are clearly defined to ensure compatibility among downstream consumers. This is a good practice.


81-85: Package Manager and Versioning

Specifying "packageManager": "pnpm@9.6.0" standardizes the tooling across the repository. The version bump to "0.0.1" is appropriate as an initial release version—just remember to update it as further changes are made.

packages/ant-design-x-vue/src/index.ts (1)

1-2: Centralized API Export

Re-exporting everything from @ant-design-x-vue/components in this new index.ts provides a clean, centralized access point for consumers. This approach enhances modularity and simplifies import paths in other parts of the project.

packages/components/package.json (1)

1-17: New Components Package Setup

The new package.json for @ant-design-x-vue/components is succinct and well-structured. It correctly establishes the package metadata, designates index.ts for both main and module fields, and includes essential scripts for testing, type checking, and linting. The peer dependency on Vue ensures that consumers adhere to the required version. Consider expanding the description further as the package evolves.

internal/build-utils/build.config.ts (1)

1-10: Build configuration looks well-structured

The build configuration uses unbuild to set up a clean, standardized build process with TypeScript declarations and CommonJS output support. This is a good foundation for the monorepo structure.

docs/.vitepress/plugins/markdown-transform.ts (1)

5-5: Import path update aligns with monorepo structure

Changing the import from a relative path to a package reference (@ant-design-x-vue/build-utils) is appropriate for a monorepo setup. This improves maintainability by reducing path complexity and making dependencies explicit.

packages/ant-design-x-vue/vite.config.mts (2)

3-5: Import statements reordering

The reordering of imports follows a logical structure and improves code organization.


28-28: Consistent object key styling

Removing quotes from the vue key is a minor stylistic change that maintains consistency with typical JavaScript object notation.

play/vite.config.ts (1)

15-15:

❓ Verification inconclusive

Simplified configuration aligns with monorepo architecture

Removing the path alias for ant-design-x-vue is appropriate in a monorepo setup where packages can be referenced directly through workspace dependencies. However, ensure that all imports in the play directory have been updated to use the workspace package reference instead of relying on this alias.


🏁 Script executed:

#!/bin/bash
# Check if there are any imports using 'ant-design-x-vue' in the play directory
echo "Checking for imports of 'ant-design-x-vue' in play directory:"
rg -t ts -t vue "from\s+['\"]ant-design-x-vue['\"]" play/

Length of output: 230


#!/bin/bash
echo "Searching for 'ant-design-x-vue' imports in TypeScript files in the play directory:"
rg -t ts "from\s+['\"]ant-design-x-vue['\"]" play/

echo ""
echo "Searching for 'ant-design-x-vue' imports in Vue files in the play directory:"
rg "from\s+['\"]ant-design-x-vue['\"]" -g '*.vue' play/

Action Required: Confirm Import Updates for "ant-design-x-vue"

The removal of the path alias for ant-design-x-vue is aligned with our monorepo strategy, where packages are referenced directly via workspace dependencies. However, before finalizing this change, please verify that no files in the play directory—neither TypeScript nor Vue—are still importing ant-design-x-vue using the old alias. Use the updated script above to perform a comprehensive check.

  • Ensure that all TS files in play/ no longer use the alias.
  • Confirm that Vue files are also free from residual alias imports.

Please run the provided script and manually verify the results before merging.

internal/build-utils/package.json (1)

1-28: New Package Metadata: Structure and Exports are Well-Defined

This new package.json sets up the @ant-design-x-vue/build-utils package with clear metadata, export mappings (for types, ESM, and CommonJS), and a dedicated stub script. The use of a devDependency (unbuild) with an appropriate version constraint is in line with best practices for internal build utilities.

tsconfig.json (2)

13-16: Updated Path Mappings Reflect the Monorepo Structure

The new alias mappings—specifically "ant-design-x-vue": ["packages/ant-design-x-vue"] and "@ant-design-x-vue/*": ["packages/*"]—align well with the reorganized monorepo layout. Please ensure that all module references in the codebase are updated accordingly.


21-21: Refined Include Paths

Changing the include from the old "src/**/*" to "packages/components/**/*" (while still including docs and internal) accurately reflects the new file structure and focuses type-checking on the components directory.

packages/ant-design-x-vue/package.json (4)

1-14: Robust Package Setup with Comprehensive Metadata

The package metadata for ant-design-x-vue is thorough—covering description, keywords, versioning, and author details. This new setup is an important step toward a well-organized monorepo.


24-31: Clear Export Definitions

The exports field accurately defines the entry points for types, ESM, and CommonJS as well as handles CSS file exposure. This creates a smooth consumption experience for various module formats.


39-46: Scripts Reflect a Monorepo Build and Release Workflow

The build, watch, changelog, release, and publish scripts seem to be well-thought-out for integrating with the monorepo setup. Just verify that the test script (which filters @ant-design-x-vue/components) fits your overall testing strategy.


69-78: Organized Dependencies Management

The dependencies and devDependencies are well segmented. Using "workspace:*" for @ant-design-x-vue/components helps enforce inter-package version consistency within the monorepo.

tsconfig.build.json (3)

7-8: Updated Declaration Directory Aligns with the New Package Structure

Changing "declarationDir" to "packages/ant-design-x-vue/dist/typings" ensures that generated type declarations are output directly into the package’s distribution folder. This change supports the monorepo’s modular organization.


16-17: Simplified Path Mapping for Components

Mapping "@ant-design-x-vue/components" to ["./packages/components"] streamlines module resolution. Just make sure that all internal imports reference this alias as intended.


23-29: Optimized Include/Exclude Settings for TypeScript

The revised include and exclude arrays focus on the necessary TypeScript files within packages/components while excluding test files (__tests__). This setup is optimal for production builds and declaration generation.

@wzc520pyfm
Copy link
Owner

wzc520pyfm commented Mar 21, 2025

我发现有一些地方仍需要调整,稍晚些时候我同步提交上来

@yuguaa
Copy link
Author

yuguaa commented Mar 21, 2025

冲突的这个文件直接使用最新的文件内容就可以了

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
.gitignore (1)

15-23: Comprehensive Management of Local Environment Files
The # local env files section consolidates various temporary folders from both VitePress and Dumi. For maintainability, consider verifying if the VitePress (e.g. docs/.vitepress/cache, etc.) and Dumi entries could be grouped separately if their lifecycles differ. This is, however, a matter of personal/team preference.

packages/ant-design-x-vue/package.json (1)

1-14: Solid Package Metadata and Naming
The metadata (name, version, description, keywords) is clearly defined. One suggestion is to enhance the repository field by including a URL for improved discoverability; for example:

 {
-  "repository": {
-    "type": "git"
-  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/wzc520pyfm/ant-design-x-vue.git"
+  },
package.json (1)

77-86: Versioning and Publishing Setup
The packageManager, publishConfig, and "version": "0.0.1" entries are appropriately set for an initial monorepo release. Note that the "prepublishOnly": "npm run test && npm run build" script (on line 19) might benefit from using pnpm for consistency across the repository. For example:

-"prepublishOnly": "npm run test && npm run build",
+"prepublishOnly": "pnpm run test && pnpm run build",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 49f77ce and 138d72d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • .gitignore (1 hunks)
  • docs/.vitepress/config.mts (1 hunks)
  • docs/.vitepress/plugins/demo.ts (1 hunks)
  • docs/.vitepress/plugins/markdown-transform.ts (1 hunks)
  • docs/package.json (1 hunks)
  • docs/tsconfig.json (1 hunks)
  • internal/build-utils/build.config.ts (1 hunks)
  • internal/build-utils/package.json (1 hunks)
  • package.json (2 hunks)
  • packages/ant-design-x-vue/package.json (1 hunks)
  • packages/ant-design-x-vue/src/index.ts (1 hunks)
  • packages/ant-design-x-vue/vite.config.mts (2 hunks)
  • packages/components/package.json (1 hunks)
  • play/package.json (2 hunks)
  • play/vite.config.ts (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • tsconfig.build.json (2 hunks)
  • tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (15)
  • docs/.vitepress/plugins/markdown-transform.ts
  • pnpm-workspace.yaml
  • packages/ant-design-x-vue/src/index.ts
  • packages/ant-design-x-vue/vite.config.mts
  • docs/.vitepress/plugins/demo.ts
  • internal/build-utils/build.config.ts
  • play/vite.config.ts
  • docs/package.json
  • docs/tsconfig.json
  • play/package.json
  • packages/components/package.json
  • internal/build-utils/package.json
  • tsconfig.json
  • docs/.vitepress/config.mts
  • tsconfig.build.json
🔇 Additional comments (16)
.gitignore (4)

1-3: Clear Categorization for Dependency Files
The introduction of the # Dependencies section with node_modules is well placed and improves clarity regarding which folders or files should be excluded from version control.


5-7: Keep System File Ignorance Simple
The # System Files section correctly retains .DS_Store. No further changes needed.


8-10: Proper Handling of Package Manager Logs
Including .pnpm-debug.log* under the # Package Manager section is an appropriate measure to ignore log files specific to pnpm.


11-14: Effective Ignorance for Bundle Artifacts
The new # Bundle section, which lists both dist and coverage, cleanly separates build output and test coverage from source files.

packages/ant-design-x-vue/package.json (7)

24-31: Well-Configured Exports Field
The exports configuration neatly maps type definitions and module paths for both ES modules and CommonJS environments, including a separate export for the CSS asset. This aligns well with Node and bundler expectations.


32-38: Clear Distribution and File Inclusion
The specification of entry points (main, module, types) along with the "files": [ "dist" ] array ensures that only the necessary build outputs are published.


39-46: Robust Script Definitions for Development and Release
The scripts cover building, watching, changelog generation, testing, and releasing. Using vite build together with TypeScript checking through vue-tsc is a solid approach.


47-51: Commit Linting Integration
The commitlint configuration with the conventional config helps maintain commit quality.


52-68: Lint-Staged Setup Ensures Code Quality
The lint-staged configuration is appropriately segmented by file extensions and applies the necessary formatters and linters.


69-80: Thoughtful Dependency Management
Dependencies are well organized, and the use of "workspace:*" for @ant-design-x-vue/components leverages the monorepo structure effectively. The peer dependencies specifying compatible versions for ant-design-vue and vue are clear.


81-87: Consistent Package Tools and Publication Configuration
The definition of the package manager (pnpm@9.6.0) and the publish configuration (with public access) is consistent with modern monorepo practices.

package.json (5)

1-9: Monorepo Structure and Workspace Definition
The root package.json now reflects the monorepo architecture. The "name" change to "ant-design-x-vue-monorepo", setting "private": true, and the clearly defined "workspaces" array ensure that multiple packages (and internal tools) are managed cohesively.


10-22: Efficient and Consistent Workspace Scripts
The scripts have been reworked to leverage pnpm commands across various workspace directories (for build, docs, play, etc.). This approach aligns with best practices in monorepo management.


23-27: Maintaining Commit Standards
The inclusion of the commitlint configuration in the root helps enforce commit message standards across the entire repository.


28-36: Streamlined Shared Dependencies
The root-level dependencies list is succinct, focusing on libraries likely shared across multiple sub-packages. This is a good practice to avoid duplication.


37-40: Robust Development Dependencies and Peer Requirements
The peer dependencies and overall devDependencies configuration mirror those in individual packages, ensuring compatibility and consistency throughout the workspace.

@wzc520pyfm
Copy link
Owner

monorepo架构是一项很棒的工作!但目前看来还不是合并的时候,因为我在调试中发现,monorepo能够暴露出一些问题,需要先着手解决,在此期间我会保持该pr与主分支同步。docs中可以使用"ant-design-x-vue": "workspace:*" ,这无需担心,之后我会调整netify配置让其正常构建。

发现的问题:

  • 文档构建后,存在主题异常(prompts即可复现)
  • 文档dev存在vue警告

我认为这些问题不是mono导致的,而是mono将其暴露出来了。

@wzc520pyfm wzc520pyfm marked this pull request as draft March 21, 2025 16:25
@yuguaa
Copy link
Author

yuguaa commented Mar 21, 2025

monorepo架构是一项很棒的工作!但目前看来还不是合并的时候,因为我在调试中发现,monorepo能够暴露出一些问题,需要先着手解决,在此期间我会保持该pr与主分支同步。docs中可以使用"ant-design-x-vue": "workspace:*" ,这无需担心,之后我会调整netify配置让其正常构建。

发现的问题:

  • 文档构建后,存在主题异常(prompts即可复现)
  • 文档dev存在vue警告

我认为这些问题不是mono导致的,而是mono将其暴露出来了。

是的,看了下我自己部署的netlify,深色主题下主题色存在问题,强刷偶尔也能正常观看,还存在较大问题

@wzc520pyfm
Copy link
Owner

wzc520pyfm commented Mar 21, 2025

是的,看了下我自己部署的netlify,深色主题下主题色存在问题,强刷偶尔也能正常观看,还存在较大问题

如果你愿意帮忙排查修复的话,可以为修复单独创建pr(建议一次一个修复,可分批pr),此pr只要专注于monorepo架构调整即可(看起来已完成了)。

@yuguaa
Copy link
Author

yuguaa commented Mar 23, 2025

是的,看了下我自己部署的netlify,深色主题下主题色存在问题,强刷偶尔也能正常观看,还存在较大问题

如果你愿意帮忙排查修复的话,可以为修复单独创建pr(建议一次一个修复,可分批pr),此pr只要专注于monorepo架构调整即可(看起来已完成了)。

image
暂时没有看出来monorepo问题,这样可以暂时解决

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