ruvector/npm/core/test-binding.mjs
rUv eefcc5322b feat: Add multi-platform GitHub Actions workflow for native module builds
Phase 2: Multi-Platform Native Builds

This commit adds comprehensive GitHub Actions CI/CD for building native
NAPI modules across all major platforms:

 Features:
- GitHub Actions workflow with 5-platform matrix build:
  - Linux (x64, ARM64)
  - macOS (x64 Intel, ARM64 Apple Silicon)
  - Windows (x64)
- Parallel builds complete in 7-10 minutes
- Automated artifact uploads and publishing
- Platform-specific npm packages with smart detection

📦 Package Structure:
- @ruvector/core - Main package with platform detection
- @ruvector/core-{platform} - Platform-specific binaries
- Smart loader with automatic platform selection
- Optional dependencies ensure minimal install size

🔧 Developer Tools:
- scripts/publish-platforms.js - Automated publishing
- Comprehensive TypeScript definitions
- Smoke tests for each platform
- Local build support with napi build

📚 Documentation:
- docs/BUILD_PROCESS.md - Complete build guide
- docs/PHASE2_MULTIPLATFORM_COMPLETE.md - Phase summary
- README for @ruvector/core package
- Troubleshooting and cross-compilation guides

🚀 Publishing Workflow:
1. Tag release (git tag v0.1.1)
2. Push to GitHub
3. CI builds all platforms
4. Publishes platform packages
5. Publishes main packages

Next: Phase 3 - WASM support with architectural refactoring

🤖 Generated with Claude Code
2025-11-21 13:19:13 +00:00

46 lines
1.3 KiB
JavaScript

/**
* Test to inspect what's actually exported from the native binding
*/
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
try {
const nativeBinding = require('./native/linux-x64/ruvector.node');
console.log('=== Native Binding Inspection ===\n');
console.log('Type:', typeof nativeBinding);
console.log('Is null:', nativeBinding === null);
console.log('Is undefined:', nativeBinding === undefined);
console.log('\nKeys:', Object.keys(nativeBinding));
console.log('\nProperties:');
for (const key of Object.keys(nativeBinding)) {
const value = nativeBinding[key];
console.log(` ${key}: ${typeof value}`);
if (typeof value === 'object' && value !== null) {
console.log(` Methods:`, Object.keys(value));
}
if (typeof value === 'function') {
console.log(` Is constructor:`, value.prototype !== undefined);
if (value.prototype) {
console.log(` Prototype methods:`, Object.getOwnPropertyNames(value.prototype));
}
}
}
console.log('\n=== Testing Functions ===\n');
if (nativeBinding.version) {
console.log('version():', nativeBinding.version());
}
if (nativeBinding.hello) {
console.log('hello():', nativeBinding.hello());
}
} catch (error) {
console.error('Error:', error.message);
console.error(error.stack);
}