chore: deep overhaul — ship types, fix peer deps, add tests/CI/tooling, rewrite README#48
Open
kuraydev wants to merge 6 commits into
Open
chore: deep overhaul — ship types, fix peer deps, add tests/CI/tooling, rewrite README#48kuraydev wants to merge 6 commits into
kuraydev wants to merge 6 commits into
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jspublished 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
react-native-profile-headerpeer dependency — it was imported and re-exported bylib/index.jsbut absent from the manifest.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).repository,bugs,homepagefromWrathChaos/freakycoder.comtokuraydev. npm name@freakycoder/react-native-header-viewis unchanged.types,module,react-native,exports,sideEffects: false, and afilesallowlist (lib,README.md,CHANGELOG.md,LICENSE). Dedupedkeywords.TypeScript
lib/index.d.tswith prop interfaces for all six headers (the biggest consumer-facing quality gain).ClassicHeadercorrectly typestitle(notheaderTitle).Tooling (previously none/dead)
airbnb+ deprecatedbabel-eslint.eslintrc.jswith a runnable ESLint 9 flat config (eslint.config.js) +typescript-eslint.tsconfig.json, Babel config for Jest, and npm scripts:typecheck,lint,lint:fix,format,format:check,test,build.Tests
__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 forProfileHeaderandElegantHeader), and each renders without throwing.CI
.github/workflows/ci.yml: install + typecheck + lint + format-check + test across Node 18 / 20 / 22. Extended dependabot to cover GitHub Actions.Docs & hygiene
ElegantHeaderandProfileHeader, TypeScript usage, New Architecture + Expo notes, fixed allkuraydevbadges/links, fixed broken JSX snippets (hitSlopsmissing object braces,leftIconComponentpseudo-code), and fixed the logoalttext ("React Native Bottom Bar" copy-paste error).CHANGELOG.md(Keep a Changelog; historical releases backfilled),CONTRIBUTING.md, issue templates +config.yml, and a PR template.react16.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 duplicatepackage-lock.json(keptyarn.lock). Removed the legacy Expo SDK-31app.json.New Architecture
Breaking changes / compatibility notes (recommend MINOR 1.2.0 → 1.3.0)
No documented-API break. Two low-risk compatibility notes for reviewers:
exportsmap added (previously absent). The bare import@freakycoder/react-native-header-viewand./package.jsonstill resolve (verified); deep subpath imports into internals are now blocked. No subpath was ever documented for this 1-file barrel, so dependents are unaffected.>=16.x→>=16.8.0(hooks era).react-nativefloor stays>=0.55.0and the publishedlib/index.jsships untranspiled exactly as before — no module-resolution change for existing consumers.Recommended bump is MINOR. If the maintainer prefers maximum caution around the new
exportsrestriction, 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 --noEmit— pass, 0 errors.npx eslint .— pass, 0 issues.npx prettier --check— pass, all files formatted.npx jest --ci— pass, 21/21 tests, 1 suite.main,types, andexports['.']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.