Skip to content

chore: deep overhaul — repair tooling/metadata, add CI + tests, modernize source & docs - #132

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

kuraydev wants to merge 8 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.

Review fixes applied: pushed the local HEAD commit, and bumped package.json 3.0.0 → 4.0.0 to avoid colliding with the already-published 3.0.0 on npm.

Summary

react-native-apple-card-views had not shipped in 3+ years and its tooling was broken: the lint script invoked tslint (dead, not even installed), ESLint 9 could not load the legacy .eslintrc.js, there were no tests and no CI, package metadata still pointed at the previous owner, and there were no react/react-native peer declarations. This PR is a full maintenance overhaul that repairs all of that without changing the public runtime API (the two named exports, their prop names, and the no-default-props behavior are preserved). Where the README disagreed with the code, the README was fixed to match the code, never the reverse.

The package npm name (react-native-apple-card-views) and the runtime peer (@freakycoder/react-native-bounceable) are unchanged.

Non-breaking improvements

Tooling & build

  • Replaced the dead tslint script with ESLint; migrated .eslintrc.js → flat eslint.config.js (ESLint 9).
  • Added lint, lint:fix, typecheck, test, format scripts.
  • Dedicated tsconfig.build.json; the published entry (main) and types stay at build/dist.
  • Excluded .tsbuildinfo from the published tarball (pack dropped 20.5kB → 11.4kB, 28 files).

Metadata

  • Repointed repository / homepage / bugs / author / FUNDING from the legacy WrathChaos/freakycoder URLs to kuraydev.
  • Added types, module, react-native, source, exports, and a files allowlist (npm name unchanged).
  • Removed dead/deprecated devDeps: @types/react-native, react-native-typescript-transformer, prettier-format, npm-post-install, @react-native-community/eslint-config, cpx; aligned @types/react to 18.
  • Deleted the stale root app.json (a copy-paste from react-native-header-view referencing non-existent assets).

CI

  • .github/workflows/ci.yml: install + lint + typecheck + test + build across Node 18/20/22, with assertions that build/dist/index.js and index.d.ts are produced.
  • Restored dependabot.yml (deleted in the last commit before this branch).
  • Added issue templates, PR template, CONTRIBUTING.md, CODE_OF_CONDUCT.md, and a Keep-a-Changelog CHANGELOG.md.
  • (No Swift in this repo — it is a pure JS/TS RN library — so the SPM/xcodebuild/pod-lint workflow does not apply.)

Tests

  • New jest + @testing-library/react-native suite (15 tests / 3 suites): render of all text props, onPress/onButtonPress, accessibilityRole="button" + default and overridden labels, a footnote regression guard against the old README drift, and the responsive style factory. Deterministic RNBounceable mock under __mocks__/.

Source (no public prop renames, no default changes)

  • Both cards now read useWindowDimensions() instead of capturing Dimensions.get('window') once at module load, so layout reacts to rotation/resize.
  • Wrapped in React.memo with an explicit displayName.
  • Added accessibilityRole="button", accessibilityLabel (optional prop, defaults to the title), and hitSlop on pressables.
  • Stopped spreading ...rest onto multiple elements (previously spread onto both RNBounceable and ImageBackground, twice in AppOfTheDayCard); rest now routes to the single intended pressable.
  • gradientColors kept as an accepted no-op prop (documented) rather than removed, to preserve the prop surface without pulling in a gradient dependency.

README

  • Rewrote props tables to match the code: the footnote prop is footnote (older docs said footnoteText), and the fictional default values were removed (props are required, there are no defaultProps).
  • Added TypeScript usage, a New Architecture / Old Architecture / Expo compatibility table, a peer-dependency range table, example-app run instructions, and Contributing/Changelog links.
  • Fixed badges/links to kuraydev. Kept the existing, real media references (assets/logo.png, the two screenshots, and the demo GIF all exist) — no invented screenshots.

Breaking changes (recommend v4.0.0 major)

  1. Peer floor raised: @freakycoder/react-native-bounceable >=0.1.1 → >=1.0.0, reconciling the previous three-way mismatch (package >=0.1.1, README >=1.0.3, npm latest 2.x).
  2. New peers introduced: react >=17.0.0 and react-native >=0.64.0 (deliberately wide). Consumers on very old/unpinned setups may now see peer-range install warnings.
  3. AppOfTheDayCard.iconSource type narrowed from any → ImageSourcePropType. Compile-time only; no runtime change.
  4. Added exports map. main/module/types are preserved and the bare package-name import still resolves to the same build/dist output (verified via npm pack), but strict exports-aware resolvers now only see the declared subpaths (. and ./package.json).

No runtime default values or exported names changed.

Verification

Local, Node 20.20.2 / npm 10.8.2 (no lockfile committed; CI uses npm install --legacy-peer-deps):

Gate Command Result
Typecheck tsc --noEmit pass — No errors found
Lint eslint lib pass — exit 0, no issues
Test jest --ci pass — 15 tests, 3 suites
Build tsc -p tsconfig.build.json pass — build/dist/index.js + index.d.ts emitted
Pack npm pack --dry-run 28 files, 11.4kB, ships build/dist + types + lib source, no .tsbuildinfo

Bare import resolution confirmed preserved: main/module/types still resolve to ./build/dist, and the exports map keeps a default → build/dist/index.js plus a react-native → lib source condition.

No open issues to close (0 open issues / 0 open PRs at time of writing).

kuraydev added 8 commits June 29, 2026 15:51
…le rest spread

- Read useWindowDimensions() so cards react to rotation/resize instead of capturing Dimensions.get('window') once at module load (style files become size factories; identical ratios).
- Route ...rest to a single intended pressable instead of double-spreading onto both RNBounceable and ImageBackground.
- Add accessibilityRole=button, default accessibilityLabel and hitSlop to pressable areas; add optional accessibilityLabel prop.
- Wrap both cards in React.memo with a stable displayName.
- Tighten AppOfTheDayCard.iconSource from any to ImageSourcePropType (breaking TS).
- Export IAppleCardProps and IAppOfTheDayCardProps; keep gradientColors as a documented reserved no-op.
…onfig

- package.json: repoint repository/homepage/bugs/author/funding to kuraydev; add types/module/react-native/source/exports/files fields (main + types still resolve at build/dist); add wide peerDependencies (react>=17, react-native>=0.64, bounceable>=1) + peerDependenciesMeta.
- Remove dead/deprecated devDeps (@types/react-native, react-native-typescript-transformer, prettier-format, npm-post-install, eslint-config-airbnb, @react-native-community/eslint-config, cpx); align @types/react to 18.
- Replace dead tslint script with eslint; add typecheck/test/build/lint:fix scripts; build via dedicated tsconfig.build.json.
- Migrate legacy .eslintrc.js to flat eslint.config.js (typescript-eslint + react + react-hooks + prettier).
- Update Babel preset to @react-native/babel-preset; ignore *.tsbuildinfo.
15 tests across both components and the barrel: render, prop wiring, independent onPress/onButtonPress handlers, accessibility labels, the footnote prop-name regression guard, the reserved gradientColors prop, the responsive style factory, and the public export surface. Deterministic RNBounceable test double under __mocks__.
…abot

CI runs install + lint + typecheck + test + build on Node 18/20/22 for push/PR and asserts build/dist/index.{js,d.ts} exist. Restore the dependabot.yml deleted in 828fded (npm weekly grouped dev-deps + github-actions). Repoint FUNDING to kuraydev.
…& templates

- README: correct props tables (footnote not footnoteText; drop non-existent defaults), add required/optional columns, TS usage, New Architecture/Expo compatibility table, RN/peer version matrix, example-run instructions, contributing/changelog links, kuraydev badges.
- Add CHANGELOG.md (Keep a Changelog), CONTRIBUTING.md, CODE_OF_CONDUCT.md, issue templates, PR template.
- Delete stale root app.json (copy-paste from react-native-header-view referencing non-existent assets).
@kuraydev kuraydev changed the title chore: deep overhaul — fix tooling, peers, a11y, tests, CI & docs (recommend v4.0.0) chore: deep overhaul — repair tooling/metadata, add CI + tests, modernize source & docs 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.

1 participant