Skip to content

Conversation

@gerteck
Copy link
Member

@gerteck gerteck commented Aug 10, 2025

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:

Fixes #2708

  • Remove @markbind/core dependency from root package.json
  • Refactor dangerfile.ts to remove import of logger, use simple console calls in dangerfile.ts.
  • Shift dangerfile.ts to /scripts to remove bloat in root dir.
  • Shift danger to devDependency since it's not a dependency.

I also updated the clean.js script to clean any .js files in the /scripts directory if the dangerfile.ts is compiled into js. Though it does not have to be compiled to js as it works directly passing the dangerfile.ts to danger.

Anything you'd like to highlight/discuss:

No functional difference between using MarkBind's logger wrapper (colored):

Testing instructions:

Check no regressions.

Proposed commit message: (wrap lines at 72 characters)

Remove @markbind/core dependency from root package.json

Refactor dangerfile.ts to replace logger import from @markbind/core
with native console calls, reducing unnecessary dependency overhead.

Additionally, move dangerfile.ts to /scripts directory from root.
Modularize clean.js function to clean compiled js files from
dangerfile.ts in the /scripts folder as well. Also update CI workflow.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

@gerteck gerteck marked this pull request as draft August 10, 2025 17:51
Refactor to allow clean of same directory
and also custom directory if need be
@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.84%. Comparing base (3e2372f) to head (12df48d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2742   +/-   ##
=======================================
  Coverage   52.84%   52.84%           
=======================================
  Files         130      130           
  Lines        7162     7162           
  Branches     1573     1573           
=======================================
  Hits         3785     3785           
  Misses       3222     3222           
  Partials      155      155           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gerteck gerteck marked this pull request as ready for review August 25, 2025 04:46
@gerteck gerteck requested review from AgentHagu and Copilot August 25, 2025 04:46
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 removes the dependency coupling between the root package and @markbind/core by refactoring the dangerfile to use native console logging instead of MarkBind's logger utility.

  • Moves dangerfile.ts from root to scripts directory for better organization
  • Replaces @markbind/core logger import with native console calls
  • Updates package.json to remove @markbind/core dependency and move danger to devDependencies

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/dangerfile.ts Replaces logger import with console calls and adds eslint disable comment
scripts/clean.js Extends cleanup functionality to handle compiled files in scripts directory
package.json Removes @markbind/core dependency and moves danger to devDependencies
.github/workflows/check-file-diff.yml Updates dangerfile path and Node.js version
.eslintrc.js Adds eslint override for scripts directory to allow devDependency imports

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +31 to +35
console.warn(`WARN: Detected issues with file couplings:\n${messages.join('\n')}`);
console.warn('WARN: Please ensure implementation changes are accompanied '
+ 'by corresponding test or documentation updates.');
} else {
logger.info('All file couplings are correctly updated.');
console.info('info: All file couplings are correctly updated.');
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

[nitpick] The log messages now include hardcoded prefixes like 'WARN:' and 'info:' which creates inconsistent formatting. Consider using a simple helper function for consistent log formatting or stick to the native console methods without prefixes.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

@gerteck gerteck Aug 25, 2025

Choose a reason for hiding this comment

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

I added the prefixes as the CLI on github actions doesn't show a differentiation in color or otherwise for warn/info/error.

#2523
Ultimately, the end state would be to directly use .warn(), .info() from the danger import itself. So there wouldn't be native console methods. So I am fine with doing it this way for now.

Once the Danger integration stabilizes, these should be replaced with direct calls to danger.warn() and danger.info()
for consistent reporting within the Danger system.

Copy link
Contributor

@AgentHagu AgentHagu left a comment

Choose a reason for hiding this comment

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

LGTM! As you've already mentioned, once Danger integration looks finished, we can use danger's API for warnings and info messages. We could also look into whether we want to use Danger.fail instead of .warn for the coupling issues.

For now, we should create a follow-up issue on tracking the accuracy of the coupling detection as mentioned in #2709.

@gerteck
Copy link
Member Author

gerteck commented Aug 31, 2025

Have made a follow up issue #2744 for continuity of this feature! wil merge this refactor PR and close the issue.

@gerteck gerteck merged commit b434884 into MarkBind:master Aug 31, 2025
14 checks passed
@gerteck gerteck deleted the branch-removeDangerCouplingtoCore branch August 31, 2025 03:50
@github-actions github-actions bot added the r.Patch Version resolver: increment by 0.0.1 label Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r.Patch Version resolver: increment by 0.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outdated @markbind/core dependency in root package.json (used by dangerfile.ts)

2 participants