Skip to content

Conversation

@rivka-ungar
Copy link
Contributor

@rivka-ungar rivka-ungar commented Nov 10, 2025

User description

https://monday.monday.com/boards/3532714909/views/80492480/pulses/18371348991


PR Type

Enhancement


Description

  • Support @vibe/* imports in metadata generation

  • Load source files from separate component packages

  • Generate correct import paths for separated packages

  • Ensure output directory exists before writing metadata


Diagram Walkthrough

flowchart LR
  A["Export declarations"] -->|Check if @vibe/*| B["Resolve @vibe/* imports"]
  A -->|Regular imports| C["Resolve relative paths"]
  B --> D["Load component packages"]
  C --> D
  D --> E["Generate metadata"]
  E --> F["Map to correct import paths"]
  F --> G["Write metadata.json"]
Loading

File Walkthrough

Relevant files
Enhancement
generate-metadata.ts
Support @vibe/* imports and separated packages                     

packages/core/src/scripts/generate-metadata.ts

  • Added handling for @vibe/* imports by resolving them to separate
    component package paths
  • Extended project source file loading to include separate component
    packages from ../../../components
  • Implemented logic to determine correct import paths based on file
    location (use @vibe/{pkg} for separated packages)
  • Added directory creation before writing metadata.json to ensure output
    path exists
+23/-3   

@qodo-merge-for-open-source
Copy link
Contributor

qodo-merge-for-open-source bot commented Nov 10, 2025

PR Reviewer Guide 🔍

(Review updated until commit f7c4862)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Hardcoded Path Assumption

The code assumes a specific directory structure with ../../../components/${pkgName}/src/index.ts for @vibe/* packages. This hardcoded path may break if the monorepo structure changes or if packages are located elsewhere. Consider using a more robust package resolution mechanism or making the path configurable.

const pkgPath = path.resolve(__dirname, `../../../components/${pkgName}/src/index.ts`);
if (fs.existsSync(pkgPath)) matchedPaths = [pkgPath];
Silent Failure

When a @vibe/* import is specified but the package path doesn't exist, matchedPaths becomes an empty array with no warning or error. This could lead to missing exports in the metadata without any indication of what went wrong. Consider logging a warning when an expected package path is not found.

if (modSpec.startsWith("@vibe/")) {
  const pkgName = modSpec.replace("@vibe/", "");
  const pkgPath = path.resolve(__dirname, `../../../components/${pkgName}/src/index.ts`);
  if (fs.existsSync(pkgPath)) matchedPaths = [pkgPath];
Regex Fragility

The regex pattern /\/components\/([^/]+)\/src\// used to extract package names from file paths is fragile and may not handle edge cases like Windows paths or variations in directory structure. Consider using path module utilities for more robust path parsing.

const pkgMatch = agg.filePath.match(/\/components\/([^/]+)\/src\//);
const importPath = pkgMatch ? `@vibe/${pkgMatch[1]}` : `@vibe/core${agg.aggregator === "next" ? "/next" : ""}`;

@github-actions
Copy link
Contributor

A new prerelease version of this PR has been published! 🎉
To install this prerelease version, run the following command in your terminal with any one of the packages changed in this PR:

To update @vibe/button:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/icon:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/loader:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/config:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/core:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/docs:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/icons:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

To update @vibe/shared:

yarn add @vibe/[email protected]

Or with npm:

npm i @vibe/[email protected]

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants