Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Aug 14, 2025

Important

Fix path in commitVersionChanges() in publish-npm.cjs to correctly filter git status for packages/types/npm/package.

  • Bug Fix:
    • Corrects path in commitVersionChanges() in publish-npm.cjs from packages/sdk/npm/package to packages/types/npm/package to ensure correct git status filtering.

This description was created by Ellipsis for 37b93b2. You can customize this summary. It will automatically update as commits are pushed.

@cte cte requested review from jr and mrubens as code owners August 14, 2025 10:17
@cte cte merged commit 48af73d into main Aug 14, 2025
10 checks passed
@cte cte deleted the cte/fix-publish-npm-script branch August 14, 2025 10:17
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 14, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 14, 2025
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Aug 14, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for this bug fix! The change correctly addresses the issue by updating the path from packages/sdk/npm/package to packages/types/npm/package. I've reviewed the changes and have some suggestions for future improvements.

try {
const status = execSync("git status --porcelain", { encoding: "utf8" })
const relevantChanges = status.split("\n").filter((line) => line.includes("packages/sdk/npm/package"))
const relevantChanges = status.split("\n").filter((line) => line.includes("packages/types/npm/package"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Good fix! For future improvements, consider adding a validation check to ensure the path exists before filtering. This would make the script more robust:

Suggested change
const relevantChanges = status.split("\n").filter((line) => line.includes("packages/types/npm/package"))
const relevantChanges = status.split("
").filter((line) => {
const targetPath = "packages/types/npm/package";
if (!fs.existsSync(path.join(rootDir, "..", targetPath.split("/")[0]))) {
console.warn(` ⚠️ Path may not exist`);
}
return line.includes(targetPath);
})

try {
const status = execSync("git status --porcelain", { encoding: "utf8" })
const relevantChanges = status.split("\n").filter((line) => line.includes("packages/sdk/npm/package"))
const relevantChanges = status.split("\n").filter((line) => line.includes("packages/types/npm/package"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider extracting this path to a constant at the top of the file (similar to how npmDir is defined) to avoid hardcoding and make future maintenance easier. For example:

const GIT_FILTER_PATH = "packages/types/npm/package";

Then use it here as .filter((line) => line.includes(GIT_FILTER_PATH))

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

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants