Skip to content

chore: deep overhaul — ship types, fix peer deps, add tests/CI/tooling, rewrite README#48

Open
kuraydev wants to merge 6 commits into
masterfrom
chore/deep-overhaul-2026
Open

chore: deep overhaul — ship types, fix peer deps, add tests/CI/tooling, rewrite README#48
kuraydev wants to merge 6 commits into
masterfrom
chore/deep-overhaul-2026

Conversation

@kuraydev

@kuraydev kuraydev commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Automated deep-overhaul PR — review before merge.

Summary

This is a maintenance overhaul of @freakycoder/react-native-header-view, a barrel package that re-exports six standalone React Native header components (Gorgeous, Apple, Modern, Classic, Profile, Elegant). The last release was 1.2.0 in 2021; the repo had no types, no CI, no tests, an unrunnable lint config, broken/incomplete docs, and a missing peer dependency.

The overhaul is intentionally additive and non-breaking: the npm name/scope, all six named exports, runtime defaults, and the untranspiled lib/index.js published output are all unchanged. The single-file barrel needed no runtime source change — the public API was already correct; the bugs were in the manifest, docs, and (absent) tooling.

Non-breaking improvements

Package correctness & metadata

  • Added the missing react-native-profile-header peer dependency — it was imported and re-exported by lib/index.js but absent from the manifest.
  • Marked all six header sub-packages optional via peerDependenciesMeta, so consumers who use a subset are no longer warned about the rest (this also neutralizes the unmet-peer warning that adding profile-header would otherwise introduce).
  • Repointed repository, bugs, homepage from WrathChaos/freakycoder.com to kuraydev. npm name @freakycoder/react-native-header-view is unchanged.
  • Added types, module, react-native, exports, sideEffects: false, and a files allowlist (lib, README.md, CHANGELOG.md, LICENSE). Deduped keywords.

TypeScript

  • Shipped lib/index.d.ts with prop interfaces for all six headers (the biggest consumer-facing quality gain). ClassicHeader correctly types title (not headerTitle).

Tooling (previously none/dead)

  • Replaced the never-installed airbnb + deprecated babel-eslint .eslintrc.js with a runnable ESLint 9 flat config (eslint.config.js) + typescript-eslint.
  • Added Prettier config (backs the existing README badge), tsconfig.json, Babel config for Jest, and npm scripts: typecheck, lint, lint:fix, format, format:check, test, build.

Tests

  • Added __tests__/index.test.tsx — a 21-case contract suite that mocks all six sub-packages and asserts: the export set is exactly the six headers, each is wired to the correct source module by identity (with explicit regression cases for ProfileHeader and ElegantHeader), and each renders without throwing.

CI

  • Added .github/workflows/ci.yml: install + typecheck + lint + format-check + test across Node 18 / 20 / 22. Extended dependabot to cover GitHub Actions.

Docs & hygiene

  • Rewrote the README: Table of Contents, single copy-paste install command covering all sub-packages, accurate props/API tables, newly documented ElegantHeader and ProfileHeader, TypeScript usage, New Architecture + Expo notes, fixed all kuraydev badges/links, fixed broken JSX snippets (hitSlops missing object braces, leftIconComponent pseudo-code), and fixed the logo alt text ("React Native Bottom Bar" copy-paste error).
  • Added CHANGELOG.md (Keep a Changelog; historical releases backfilled), CONTRIBUTING.md, issue templates + config.yml, and a PR template.
  • Modernized the example app: react 16.13.1 → 18.1.0 (was an invalid pairing with RN 0.70.6), aligned Jest 29, demoed all six headers (was Gorgeous-only), removed the duplicate package-lock.json (kept yarn.lock). Removed the legacy Expo SDK-31 app.json.

New Architecture

  • Documented explicitly: a pure-JS barrel with zero native code is Fabric/TurboModule auto-compatible; actual readiness is delegated to the six wrapped sub-packages (not controlled by this repo). No native peer floors raised.

Breaking changes / compatibility notes (recommend MINOR 1.2.0 → 1.3.0)

No documented-API break. Two low-risk compatibility notes for reviewers:

  • exports map added (previously absent). The bare import @freakycoder/react-native-header-view and ./package.json still resolve (verified); deep subpath imports into internals are now blocked. No subpath was ever documented for this 1-file barrel, so dependents are unaffected.
  • react peer floor narrowed >=16.x>=16.8.0 (hooks era). react-native floor stays >=0.55.0 and the published lib/index.js ships untranspiled exactly as before — no module-resolution change for existing consumers.

Recommended bump is MINOR. If the maintainer prefers maximum caution around the new exports restriction, a MAJOR is defensible, but the changes are functionally additive.

Verification (local, real results)

  • npm install --legacy-peer-deps — ok (565 packages; 18 moderate advisories in transitive dev deps only).
  • npx tsc --noEmitpass, 0 errors.
  • npx eslint .pass, 0 issues.
  • npx prettier --checkpass, all files formatted.
  • npx jest --cipass, 21/21 tests, 1 suite.
  • Resolution sanity check — main, types, and exports['.'] all resolve to existing files; npm name confirmed unchanged.

(No Swift toolchain applies — this is a pure-JS RN aggregator with zero native code; no SPM/Xcode/pod targets exist.)

Closes #36.

kuraydev added 5 commits June 29, 2026 15:56
…tadata

- Add react-native-profile-header to peerDependencies (it was imported and
  re-exported by lib/index.js but absent from the manifest)
- Mark all six header sub-packages as optional via peerDependenciesMeta
- Add TypeScript definitions (lib/index.d.ts) with prop interfaces for all
  six headers; add types/module/react-native/exports/sideEffects/files fields
- Repoint repository/bugs/homepage from WrathChaos/freakycoder.com to kuraydev
- Keep main -> lib/index.js untouched (module resolution preserved)
- Deduplicate keywords
- Replace dead airbnb + babel-eslint .eslintrc.js with ESLint 9 flat config
- Add Prettier config (backs the README badge) and ignore list
- Add root tsconfig.json for tsc --noEmit typecheck
- Point babel.config.js at generic presets for Jest (not shipped)
- Add jest.config.js
- Add GitHub Actions CI: lint + typecheck + format check + test on Node 18/20/22
- Widen dependabot to /example and github-actions, weekly
Mocks all six sub-packages (virtual mocks) and asserts every named export
exists, is wired to the correct source module, and renders. Guards the
profile-header regression and the undocumented ElegantHeader export.
- Rewrite README: TOC, single copy-paste install for all sub-packages,
  document ElegantHeader and ProfileHeader, TypeScript + New Architecture/Expo
  notes, fixed badges/links (kuraydev), absolute image URLs that render on npm
- Fix ClassicHeader title prop docs (title, not headerTitle) — closes #36
- Fix broken JSX snippets (hitSlops braces, leftIconComponent pseudo-code)
- Fix logo alt text; remove stale embedded changelog
- Convert CHANGELOG.md to Keep a Changelog with an Unreleased section
- Add CONTRIBUTING.md, issue templates, and a PR template
- Fix invalid React/RN pairing (react 16.13.1 -> 18.1.0 for RN 0.70.6) and
  align react-test-renderer
- Fix jest/babel-jest/typescript version skew; bump community eslint config
- Add react-native-elegant-header and demo all six headers in App.tsx using
  the corrected ClassicHeader `title` prop
- Dedupe to a single lockfile (remove example/package-lock.json)
@kuraydev kuraydev changed the title chore: deep overhaul — ship types, fix profile-header peer dep, modern tooling/CI, README rewrite chore: deep overhaul — ship types, fix peer deps, add tests/CI/tooling, rewrite README Jun 29, 2026
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.

ClassicHeader component props is fault, not headerTitle but title.

1 participant