Skip to content

chore: align tooling with react-native-typescript-library-starter - #17

Merged
kuraydev merged 1 commit into
masterfrom
chore/align-with-library-starter
Aug 12, 2026
Merged

chore: align tooling with react-native-typescript-library-starter#17
kuraydev merged 1 commit into
masterfrom
chore/align-with-library-starter

Conversation

@kuraydev

Copy link
Copy Markdown
Owner

Brings the library in line with react-native-typescript-library-starter and fixes the husky v10 deprecation warnings.

Structure & build

  • Sources moved from lib/ to src/ with an index.ts barrel (default export preserved — import SegmentedControl from "react-native-segmented-control-2" keeps working; SegmentedControl, SegmentedControlProps, and TabItem are now also named exports).
  • Build switched from the custom tsc script to react-native-builder-bob: dual CJS/ESM output plus type definitions in lib/, with proper main/module/types/exports fields.
  • files: ["src", "lib"] replaces .npmignore — the npm tarball now ships only sources and build output (26 files, no more .idea/.husky/scripts junk).

Tooling

  • husky v9 hook format — removes the deprecated husky.sh boilerplate that v10 will reject.
  • pre-commit now runs lint-staged (eslint --fix + prettier on staged files); commit-msg keeps commitlint.
  • Starter's eslint/prettier/tsconfig/babel configs adopted; devDependencies aligned.
  • Jest + @testing-library/react-native suite added: 9 tests covering tab rendering, uncontrolled/controlled selection, accessibility state, disabled, custom element tabs, tabStyle functions, and insetShadow. Coverage: 100% statements/lines/functions, 91% branches (thresholds 80/80/80/70).
  • GitHub Actions CI (typecheck, lint, prettier, tests with coverage, build) on push/PR to master.

Verified

  • npm run typechecknpm run lint:cinpm run prettier:cinpm run test:coverage ✅ (9/9) npm run build
  • npm pack --dry-run produces a clean tarball; the example app consumes the package from npm and is unaffected.

Note: version stays 2.2.0 since it was never published — this restructure can ship as part of that release.

Moves sources to src/ with an index barrel, builds dual CJS/ESM + type
definitions via react-native-builder-bob into lib/, and publishes only
src + lib through the files field (replacing .npmignore and the custom
build scripts).

Modernizes husky hooks to the v9 format (drops the boilerplate that v10
will reject), wires lint-staged into pre-commit, adopts the starter's
eslint/prettier/tsconfig/babel configs, and adds a jest +
testing-library suite with a CI workflow running typecheck, lint,
tests with coverage, and build.
@kuraydev
kuraydev force-pushed the chore/align-with-library-starter branch from af77557 to 6cea687 Compare August 12, 2026 14:18
@kuraydev
kuraydev merged commit 1515df3 into master Aug 12, 2026
4 checks passed
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