Skip to content

Conversation

@ericpsimon
Copy link
Contributor

@ericpsimon ericpsimon commented Oct 3, 2025

Summary

  • ✨ Added unified data source bindings for TypeScript with support for files, cloud storage, and in-memory data
  • πŸ”„ Migrated Node.js bindings from JavaScript to TypeScript for better type safety
  • πŸ“¦ Restructured package to use TypeScript compilation with proper npm packaging

Key Features

Data Source Support

  • File Sources: CSV, Parquet, JSON support with schema inference
  • Cloud Storage: S3 integration with configurable credentials
  • In-Memory: Direct DataFrame creation from JavaScript arrays
  • DataFusion: Raw SQL queries against registered tables

TypeScript Migration

  • Converted all .js files to .ts with full type definitions
  • Added tsconfig.json with strict type checking
  • Updated build process to compile TypeScript before NAPI build
  • Configured proper npm packaging to exclude source files

Changes

  • πŸ—οΈ Restructured Node.js bindings from term-guard-node/ to node/term-guard/
  • πŸ“ Added comprehensive TypeScript type definitions
  • πŸ”§ Updated package.json to use TypeScript toolchain
  • πŸ“¦ Added .npmignore for clean npm packages
  • βœ… Migrated all tests to TypeScript

Test Plan

  • CI builds pass with new directory structure
  • TypeScript compilation succeeds
  • All data source types tested (CSV, Parquet, JSON, S3, Memory)
  • Node.js bindings compile correctly
  • Tests run successfully with tsx

Example Usage

import { ValidationSuite, DataSource } from 'term-guard';

// CSV file
const csvSource = DataSource.fromCsv('/path/to/file.csv', {
  hasHeader: true,
  delimiter: ',',
  schema: { /* optional schema */ }
});

// S3 Parquet file
const s3Source = DataSource.fromS3Parquet('s3://bucket/file.parquet', {
  region: 'us-west-2',
  accessKeyId: 'key',
  secretAccessKey: 'secret'
});

// In-memory data
const memorySource = DataSource.fromMemory([
  { id: 1, name: 'Alice', age: 30 },
  { id: 2, name: 'Bob', age: 25 }
]);

// Run validation
const suite = new ValidationSuite('orders', csvSource);
const result = await suite.run();

πŸ€– Generated with Claude Code

@ericpsimon ericpsimon force-pushed the 10-03-refactor_restructure_node.js_bindings_to_node_term-guard_directory branch 4 times, most recently from 68559bc to 382315e Compare October 3, 2025 18:26
- Moved all Node.js binding files from term-guard-node/ to node/term-guard/
- Updated Cargo.toml workspace configuration
- Fixed term-guard dependency path in node/term-guard/Cargo.toml
- Updated GitHub Actions workflow paths
- Added proper .gitignore for Node.js dependencies and build artifacts
- Simplified NAPI CI workflow:
  - Removed matrix builds (out of scope for this project)
  - Single Linux build for development
  - Combined build and test into one job
  - Only upload artifacts from main branch
- Updated to use npm instead of yarn
- Aligned with project CI patterns
@ericpsimon ericpsimon force-pushed the 10-03-refactor_restructure_node.js_bindings_to_node_term-guard_directory branch from 382315e to f46d0d3 Compare October 3, 2025 18:30
@ericpsimon ericpsimon changed the title refactor: restructure Node.js bindings to node/term-guard directory feat(TER-347): Add unified data source bindings for TypeScript Oct 9, 2025
- Convert index.js to index.ts with proper TypeScript types
- Convert test/index.test.js to test/index.test.ts with interfaces
- Add comprehensive TypeScript type definitions in index.d.ts
- Update package.json to use TypeScript compilation pipeline
- Configure tsconfig.json for CommonJS module output
- Update build scripts to compile TypeScript before NAPI build
- Add tsx for running TypeScript tests directly
- Update .gitignore and .npmignore for TypeScript workflow
- Remove old JavaScript files in favor of TypeScript
@ericpsimon ericpsimon force-pushed the 10-03-refactor_restructure_node.js_bindings_to_node_term-guard_directory branch from 8caf22a to 4180ec6 Compare October 9, 2025 19:25
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