Skip to content

Migrate to typescript and make new distribution files

Compare
Choose a tag to compare
@SMAKSS SMAKSS released this 16 Nov 23:29
· 18 commits to master since this release
c52cbbb

🌟 Release Notes for @smakss/search - Version 2.0.0 🌟

Overview πŸ“‹

We are thrilled to announce the release of version X.Y.Z of our Search functionality. This update introduces significant improvements in code organization, readability, and documentation, making your search experience smoother and more efficient.

What's New πŸ†•

  • Modular Code Structure πŸ“: The search functionality has been divided into smaller, more manageable files (types.ts, utils.ts, searchLogic.ts, search.ts).
  • TypeScript Integration 🌐: Full conversion of the codebase to TypeScript, providing strong typing and reducing potential runtime errors.
  • Enhanced Readability πŸ“–: Refactoring of existing code for greater clarity and readability.
  • JSDoc Documentation πŸ“š: Comprehensive JSDoc comments have been added, offering detailed explanations and usage examples.
  • Utility Function Improvements βš™οΈ: Refinement of utility functions for more efficient and reliable operation.

Breaking Changes πŸ’₯

  • File Structure πŸ—‚οΈ: Functions are now distributed across multiple files. Users will need to update their import paths.
  • TypeScript Adoption πŸ“˜: The codebase is now in TypeScript, which may require changes in JavaScript projects.

Migration Guide πŸš€

To migrate from a previous version, please consider the following steps:

  1. Update import statements to match the new file structure, e.g., import { search } from './search';.
  2. For JavaScript integration, ensure your build tooling supports TypeScript.
  3. Review your implementation for compatibility with the new TypeScript types and interfaces.

Examples πŸ’‘

Here's a quick example of how to use the new search functionality:

import search from './search';
import { SearchItem } from './types';

// Sample data
const items: SearchItem[] = [{ name: 'John Doe', age: 30 }, { name: 'Jane Smith', age: 25 }];

// Perform a search
const results = search({
  searchText: 'John',
  searchItems: items,
  keys: ['name'],
  include: true,
  exact: false
});

console.log(results); // Expected output: [{ name: 'John Doe', age: 30 }]

Feedback πŸ“’

Your feedback is crucial to us. Please let us know if you encounter any issues or have suggestions for future improvements.