Skip to content

Node gyp#5

Merged
MXASoundNDEv merged 3 commits intomainfrom
Node-gyp
Sep 22, 2025
Merged

Node gyp#5
MXASoundNDEv merged 3 commits intomainfrom
Node-gyp

Conversation

@MXASoundNDEv
Copy link
Copy Markdown
Owner

📋 Description

Change N-api to node-gyp

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧹 Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test improvement

🧪 How Has This Been Tested?

  • Unit tests pass
  • Integration tests pass
  • Manual testing performed
  • Tested on multiple platforms (Windows/Linux)

Test Configuration:

  • Node.js version:
  • Operating System:
  • Network interface type:

📋 Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

MXASoundNDEv and others added 3 commits September 22, 2025 14:22
…soem-addon

Replace cmake-js with node-gyp build flow
…zation, and update README and CHANGELOG for build system migration
Copilot AI review requested due to automatic review settings September 22, 2025 13:15
@MXASoundNDEv MXASoundNDEv merged commit 86a57c9 into main Sep 22, 2025
1 check passed
Copy link
Copy Markdown

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 migrates the build system from CMake/cmake-js to node-gyp, simplifying the build process and dependencies. The change removes the need for CMake while maintaining full compatibility with Node.js and Electron environments.

  • Replaces CMake-based build with node-gyp and binding.gyp configuration
  • Updates all build scripts and CI workflows to use node-gyp instead of cmake-js
  • Modernizes test infrastructure with improved mock handling and stub mode support

Reviewed Changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
binding.gyp New node-gyp build configuration replacing CMakeLists.txt
package.json Updates build scripts and dependencies from cmake-js to node-gyp
scripts/postinstall.js Refactored to use node-gyp instead of cmake-js for native addon building
scripts/rebuild-electron.js Complete rewrite to use node-gyp for Electron rebuilds
scripts/generate-ec-options.js New utility script for generating SOEM configuration headers
test files Enhanced test infrastructure with better mock handling and stub mode support
CI/build scripts Updated to use node-gyp throughout the build pipeline
README.md Updated documentation removing CMake references and simplifying setup

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

Comment on lines +17 to +20
// Enregistrer des placeholders test.todo pour indiquer comment activer ces tests
describe('Integration tests (disabled by default)', () => {
test.todo('Set RUN_INTEGRATION=true pour exécuter avec l’addon natif');
test.todo('Set RUN_INTEGRATION_STUB=true pour exécuter avec le stub JS');
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

[nitpick] Mix of French and English in comments and test descriptions. Consider using consistent language throughout the codebase.

Suggested change
// Enregistrer des placeholders test.todo pour indiquer comment activer ces tests
describe('Integration tests (disabled by default)', () => {
test.todo('Set RUN_INTEGRATION=true pour exécuter avec l’addon natif');
test.todo('Set RUN_INTEGRATION_STUB=true pour exécuter avec le stub JS');
// Register test.todo placeholders to indicate how to enable these tests
describe('Integration tests (disabled by default)', () => {
test.todo('Set RUN_INTEGRATION=true to run with the native addon');
test.todo('Set RUN_INTEGRATION_STUB=true to run with the JS stub');

Copilot uses AI. Check for mistakes.
const isNotVirtual = !/WAN Miniport|Loopback|Virtual/i.test(best.description);

if (interfaces.some(iface => /Intel.*Gigabit/i.test(iface.description))) {
if (interfaces.some((iface: any) => /Intel.*Gigabit/i.test(iface.description))) {
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

Using any type annotation defeats TypeScript's type safety. Consider defining a proper interface type for network interfaces or using the existing interface structure.

Copilot uses AI. Check for mistakes.
expect(console.warn).toHaveBeenCalledWith(
'Warning: Could not list network interfaces:',
'Test error'
'Warning: Could not list network interfaces:', 'Test error'
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The error message assertion spans multiple arguments but could be more robust. Consider using expect.stringContaining() or a single string matcher to avoid brittleness from argument splitting.

Suggested change
'Warning: Could not list network interfaces:', 'Test error'
expect.stringContaining('Warning: Could not list network interfaces: Test error')

Copilot uses AI. Check for mistakes.
else
print_warning "Fichier .node non trouvé"
fi
if npx node-gyp configure build; then
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

[nitpick] The script runs configure and build in a single command. Consider separating these steps for better error handling and debugging, as configure failures have different root causes than build failures.

Copilot uses AI. Check for mistakes.
],
'include_dirs': [
'<!(node -p "require(\'node-addon-api\').include")',
'<(module_root_dir)/node_modules/node-addon-api',
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The include directory is specified twice - once dynamically via node-addon-api and once with a hardcoded path. The hardcoded path on line 19 is redundant and could cause conflicts.

Suggested change
'<(module_root_dir)/node_modules/node-addon-api',

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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