Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Report a problem with react-native-header-search-bar
title: "[Bug] "
labels: bug
---

## Describe the bug

A clear and concise description of what the bug is.

## Reproduction

Steps to reproduce, ideally with a minimal code snippet or Expo Snack:

```jsx
import { HeaderSearchBar } from "react-native-header-search-bar";

// ...
```

## Expected behavior

What you expected to happen.

## Screenshots / video

If applicable, add screenshots or a screen recording.

## Environment

- `react-native-header-search-bar` version:
- `react-native` version:
- `react` version:
- Platform: iOS / Android
- New Architecture (Fabric) enabled: yes / no
- Expo: yes / no (SDK version if yes)

## Additional context

Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea or enhancement
title: "[Feature] "
labels: enhancement
---

## Problem

Is your feature request related to a problem? A clear and concise description of what the problem is.

## Proposed solution

A clear and concise description of what you want to happen, including any new props or API surface.

## Alternatives considered

Any alternative solutions or features you've considered.

## Additional context

Add any other context, mockups, or screenshots about the feature request here.
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Thanks for contributing! Please fill out the sections below. -->

## Summary

<!-- What does this PR do and why? -->

## 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 change existing behavior/API)
- [ ] Documentation only
- [ ] Tooling / CI

## Checklist

- [ ] `npm run lint` passes
- [ ] `npm run typecheck` passes
- [ ] `npm test` passes
- [ ] `npm run build` succeeds
- [ ] I updated the `CHANGELOG.md` under `[Unreleased]`
- [ ] I did not change any public prop names or runtime defaults (or I documented the breaking change)

## Related issues

<!-- e.g. Closes #123 -->
29 changes: 24 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
# Library root (devDependencies, tooling)
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependencies
# Example app
- package-ecosystem: npm
directory: "/example"
schedule:
interval: weekly
open-pull-requests-limit: 5
labels:
- dependencies
- example
# GitHub Actions
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
labels:
- ci
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
verify:
name: Lint, typecheck, test & build (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Install dependencies
run: npm install --legacy-peer-deps --ignore-scripts

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm test -- --ci --coverage

- name: Build
run: npm run build
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ package-lock.json

node_modules

# build output (generated by react-native-builder-bob on prepare)
lib/

# test coverage
coverage/

# Xcode
#
build/
Expand Down
8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dependencies
node_modules/

# build output
lib/
coverage/

# logs
npm-debug.log
yarn-error.log

# os
.DS_Store

# lockfile (library)
package-lock.json
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "always",
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

> This release is a deep modernization of a library that had not been touched
> since 2020. It migrates the source to TypeScript and ships compiled output via
> `react-native-builder-bob`. The **public API is unchanged** (same named exports
> `HeaderSearchBar` / `HeaderClassicSearchBar`, same default object export, same
> prop names and runtime defaults), but the published package layout and minimum
> peer versions changed — see **Breaking** below. A major version bump is
> recommended.

### Added

- TypeScript source with shipped declaration files (`.d.ts`). Exported prop
interfaces: `HeaderSearchBarProps`, `HeaderClassicSearchBarProps`, `SearchBoxProps`.
- `react-native-builder-bob` build pipeline producing CommonJS, ES module and
TypeScript targets under `lib/`.
- `package.json` `exports`, `module`, `react-native`, `source`, `types` and a
`files` allowlist so only `src` + `lib` + docs are published.
- Real test suite: Jest + `@testing-library/react-native` (21 tests across both
header variants and `SearchBox`, including default props, `onChangeText`
wiring, `disableTextInput`, custom `iconComponent`, and snapshots).
- GitHub Actions CI (`.github/workflows/ci.yml`): install + lint + typecheck +
test + build on a Node 18/20/22 matrix for pushes and PRs.
- `CHANGELOG.md`, `CONTRIBUTING.md`, issue templates and a pull request template.
- Accessibility roles/labels on the hamburger button, filter ripple target and
search box.
- `react-native-material-ripple` is now declared in `peerDependencies` (it was
imported by `HeaderClassicSearchBar` but never declared).

### Changed

- Migrated linting from the deprecated `tslint`/`babel-eslint` + `airbnb` setup
to ESLint 9 flat config (`eslint.config.js`) with `typescript-eslint`,
`eslint-plugin-react` and Prettier, and added an actual `.prettierrc`
(the README advertised a Prettier badge but no config existed).
- `HeaderClassicSearchBar` now uses `useSafeAreaInsets()` instead of the removed
`useSafeArea()` API, so it works on `react-native-safe-area-context` v3/v4/v5+.
- Components are now wrapped in `React.memo` and `React.forwardRef`, and drop the
deprecated `defaultProps`/`PropTypes` in favor of typed default parameters.
- Stopped spreading `{...props}` blindly onto the menu `Icon`, the filter `Ripple`
and the filter `Icon`; only intended props are forwarded now. The deliberate
prop passthrough to the inner `SearchBox` is preserved.
- Repository, homepage and bugs URLs now point at `kuraydev`.

### Fixed

- `SearchBox` no longer creates an implicit global on every render — the inner
`renderTextInput` helper is now a proper local `const`.
- `secondTitleFontSize` is now honored. The second-title style previously
hard-coded `fontSize: 18` and silently ignored the documented prop.
- `prop-types` is no longer an undeclared import (PropTypes were removed in the
TypeScript migration).

### Removed

- Raw, uncompiled `lib/src/*.js` source is no longer the package entry point.
Consumers that deep-imported `react-native-header-search-bar/lib/src/...` must
switch to the package root import (see migration notes in the README/PR).
- Runtime `PropTypes` validation (replaced by compile-time TypeScript types).

## [0.1.10] - 2020-03-09

- Last legacy release. See git history.
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributing

Thanks for your interest in improving **react-native-header-search-bar**! 🎉

## Development setup

```sh
git clone https://github.com/kuraydev/react-native-header-search-bar.git
cd react-native-header-search-bar
npm install --legacy-peer-deps
```

> The native peer dependencies (`react-native-androw`,
> `react-native-dynamic-vector-icons`, `react-native-material-ripple`,
> `@freakycoder/react-native-helpers`) are intentionally **not** installed in the
> library's own `node_modules` — they are peer dependencies provided by the host
> app. They are mocked in the test suite (`jest.setup.js`).

## Project layout

- `src/` — TypeScript source (the only thing you edit).
- `lib/` — generated build output (CommonJS + ESM + types). **Do not edit**; it is
git-ignored and produced by `npm run build`.
- `example/` — a bare React Native example app.

## Useful scripts

| Script | Description |
| ------------------- | -------------------------------------------- |
| `npm run lint` | ESLint (flat config) |
| `npm run typecheck` | `tsc --noEmit` |
| `npm test` | Jest test suite |
| `npm run build` | Build `lib/` with `react-native-builder-bob` |
| `npm run clean` | Remove `lib/` |

Please make sure `lint`, `typecheck`, `test` and `build` all pass before opening
a pull request — CI runs the same checks on Node 18, 20 and 22.

## Pull requests

- Use [Conventional Commits](https://www.conventionalcommits.org/) for commit
messages (e.g. `fix:`, `feat:`, `chore:`, `docs:`).
- Add or update tests for any behavior change.
- Add an entry under `## [Unreleased]` in `CHANGELOG.md`.
- **Do not** rename public exports or change runtime prop defaults without
flagging it as a breaking change.

## Code style

This project uses Prettier and ESLint. Run `npm run lint:fix` and
`npx prettier --write .` before committing.
Loading
Loading