Skip to content

chore: update post commit scripts #97

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

Merged
merged 2 commits into from
Apr 19, 2025
Merged

chore: update post commit scripts #97

merged 2 commits into from
Apr 19, 2025

Conversation

Groupguanfang
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings April 19, 2025 06:58
Copy link
Contributor

@Copilot 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 updates the post-commit scripts to improve markdown generation and adjust commit message formatting.

  • Introduces a Map to build a package name to changeset mapping.
  • Modifies the commit message format in both the markdown output and commit command.
  • Updates the warning message for commits with no workspace files.
Comments suppressed due to low confidence (2)

scripts/post-commit.ts:135

  • A mapping of package names is generated twice (once via filter/map and once from workspaceCommittedFilesMap); consider consolidating these mappings to avoid duplication.
${Array.from(workspaceCommittedFilesMap.entries()).map(([packageName, changesetType]) => "\"" + packageName + "\": \"" + changesetType + "\"").join('\n')}

scripts/post-commit.ts:160

  • Verify that using 'lastCommitMessage' instead of 'commitMessage' is intentional, as this change may affect the generated markdown output.
const markdown = await createMarkdown(changesetType, workspaceCommittedFiles, lastCommitMessage, lastCommitId)

Comment on lines +155 to 156
return console.warn(k.yellow(`The commit "${lastCommitMessage}" has not files in the workspace.`))
else if (changesetMatchOptions.ignore?.some(v => v.test(lastCommitMessage)))
Copy link
Preview

Copilot AI Apr 19, 2025

Choose a reason for hiding this comment

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

The warning message uses 'has not files' which is grammatically incorrect; consider using 'has no files'.

Suggested change
return console.warn(k.yellow(`The commit "${lastCommitMessage}" has not files in the workspace.`))
else if (changesetMatchOptions.ignore?.some(v => v.test(lastCommitMessage)))
return console.warn(k.yellow(`The commit "${lastCommitMessage}" has no files in the workspace.`))

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@Groupguanfang Groupguanfang merged commit fc88967 into v1 Apr 19, 2025
2 checks passed
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