@@ -37,9 +37,7 @@ npm install
3737
3838### 2. Set up git hooks
3939
40- ``` bash
41- npm run husky:setup
42- ```
40+ Git hooks are installed automatically when you run ` npm install ` (via the ` prepare ` script). No extra step needed.
4341
4442### 3. Configure the library
4543
@@ -50,6 +48,7 @@ npm run setup
5048```
5149
5250The wizard will ask for:
51+
5352- ** Package name** — your npm name (e.g. ` react-native-my-library ` )
5453- ** Description** — one sentence
5554- ** GitHub username / org** — used to build repo URLs automatically
@@ -116,29 +115,29 @@ react-native-typescript-library-starter/
116115
117116## Scripts
118117
119- | Command | Description |
120- | ---| ---|
121- | ` npm run build ` | Build library to ` lib/ ` via bob |
122- | ` npm run typecheck ` | Type-check without emitting |
123- | ` npm run lint ` | Run ESLint with colored output and auto-fix |
124- | ` npm run lint:ci ` | ESLint without spinner (for CI) |
125- | ` npm run prettier ` | Format source files |
126- | ` npm run prettier:ci ` | Check formatting (for CI) |
127- | ` npm test ` | Run Jest tests |
128- | ` npm run test:watch ` | Jest in watch mode |
129- | ` npm run test:coverage ` | Jest with coverage report |
118+ | Command | Description |
119+ | ----------------------- | ------------------------------------------- |
120+ | ` npm run build ` | Build library to ` lib/ ` via bob |
121+ | ` npm run typecheck ` | Type-check without emitting |
122+ | ` npm run lint ` | Run ESLint with colored output and auto-fix |
123+ | ` npm run lint:ci ` | ESLint without spinner (for CI) |
124+ | ` npm run prettier ` | Format source files |
125+ | ` npm run prettier:ci ` | Check formatting (for CI) |
126+ | ` npm test ` | Run Jest tests |
127+ | ` npm run test:watch ` | Jest in watch mode |
128+ | ` npm run test:coverage ` | Jest with coverage report |
130129
131130---
132131
133132## Build Output
134133
135134` react-native-builder-bob ` produces three output targets inside ` lib/ ` :
136135
137- | Output | Path | Used by |
138- | ---| ---| ---|
139- | CommonJS | ` lib/commonjs/ ` | Node.js, bundlers with ` require() ` |
140- | ESM | ` lib/module/ ` | Modern bundlers, tree-shaking |
141- | TypeScript | ` lib/typescript/ ` | Type declarations for consumers |
136+ | Output | Path | Used by |
137+ | ---------- | ----------------- | ---------------------------------- |
138+ | CommonJS | ` lib/commonjs/ ` | Node.js, bundlers with ` require() ` |
139+ | ESM | ` lib/module/ ` | Modern bundlers, tree-shaking |
140+ | TypeScript | ` lib/typescript/ ` | Type declarations for consumers |
142141
143142The ` package.json ` ` exports ` field routes consumers to the correct output automatically.
144143
@@ -164,20 +163,20 @@ export default function App() {
164163
165164### MyComponent Props
166165
167- | Prop | Type | Default | Description |
168- | ---| ---| ---| ---|
169- | ` title ` | ` string ` | — | Primary title text (required) |
170- | ` description ` | ` string ` | — | Optional description below title |
171- | ` enableButton ` | ` boolean ` | ` false ` | Renders an action button |
172- | ` buttonText ` | ` string ` | ` "Press me" ` | Button label |
173- | ` onPress ` | ` () => void ` | — | Button press callback |
174- | ` style ` | ` StyleProp<ViewStyle> ` | — | Root container style override |
175- | ` titleStyle ` | ` StyleProp<TextStyle> ` | — | Title text style override |
176- | ` descriptionStyle ` | ` StyleProp<TextStyle> ` | — | Description text style override |
177- | ` buttonStyle ` | ` StyleProp<ViewStyle> ` | — | Button container style override |
178- | ` buttonTextStyle ` | ` StyleProp<TextStyle> ` | — | Button label style override |
179- | ` accessibilityLabel ` | ` string ` | ` title ` | Accessibility label for the container |
180- | ` testID ` | ` string ` | ` "my-component" ` | Test ID for querying in tests |
166+ | Prop | Type | Default | Description |
167+ | -------------------- | ---------------------- | ---------------- | ------------------------------------- |
168+ | ` title ` | ` string ` | — | Primary title text (required) |
169+ | ` description ` | ` string ` | — | Optional description below title |
170+ | ` enableButton ` | ` boolean ` | ` false ` | Renders an action button |
171+ | ` buttonText ` | ` string ` | ` "Press me" ` | Button label |
172+ | ` onPress ` | ` () => void ` | — | Button press callback |
173+ | ` style ` | ` StyleProp<ViewStyle> ` | — | Root container style override |
174+ | ` titleStyle ` | ` StyleProp<TextStyle> ` | — | Title text style override |
175+ | ` descriptionStyle ` | ` StyleProp<TextStyle> ` | — | Description text style override |
176+ | ` buttonStyle ` | ` StyleProp<ViewStyle> ` | — | Button container style override |
177+ | ` buttonTextStyle ` | ` StyleProp<TextStyle> ` | — | Button label style override |
178+ | ` accessibilityLabel ` | ` string ` | ` title ` | Accessibility label for the container |
179+ | ` testID ` | ` string ` | ` "my-component" ` | Test ID for querying in tests |
181180
182181---
183182
@@ -207,23 +206,23 @@ function Counter() {
207206
208207### useMyHook Options
209208
210- | Option | Type | Default | Description |
211- | ---| ---| ---| ---|
212- | ` initialValue ` | ` number ` | ` 0 ` | Starting counter value |
213- | ` max ` | ` number ` | — | Upper bound (no limit if omitted) |
214- | ` min ` | ` number ` | ` 0 ` | Lower bound |
215- | ` step ` | ` number ` | ` 1 ` | Increment/decrement amount |
209+ | Option | Type | Default | Description |
210+ | -------------- | -------- | ------- | --------------------------------- |
211+ | ` initialValue ` | ` number ` | ` 0 ` | Starting counter value |
212+ | ` max ` | ` number ` | — | Upper bound (no limit if omitted) |
213+ | ` min ` | ` number ` | ` 0 ` | Lower bound |
214+ | ` step ` | ` number ` | ` 1 ` | Increment/decrement amount |
216215
217216### useMyHook Return
218217
219- | Key | Type | Description |
220- | ---| ---| ---|
221- | ` count ` | ` number ` | Current counter value |
222- | ` increment ` | ` () => void ` | Increment by ` step ` |
223- | ` decrement ` | ` () => void ` | Decrement by ` step ` |
224- | ` reset ` | ` () => void ` | Reset to ` initialValue ` |
225- | ` isAtMax ` | ` boolean ` | ` true ` when ` count >= max ` |
226- | ` isAtMin ` | ` boolean ` | ` true ` when ` count <= min ` |
218+ | Key | Type | Description |
219+ | ----------- | ------------ | -------------------------- |
220+ | ` count ` | ` number ` | Current counter value |
221+ | ` increment ` | ` () => void ` | Increment by ` step ` |
222+ | ` decrement ` | ` () => void ` | Decrement by ` step ` |
223+ | ` reset ` | ` () => void ` | Reset to ` initialValue ` |
224+ | ` isAtMax ` | ` boolean ` | ` true ` when ` count >= max ` |
225+ | ` isAtMin ` | ` boolean ` | ` true ` when ` count <= min ` |
227226
228227---
229228
@@ -237,6 +236,7 @@ npm run test:coverage # with coverage report
237236```
238237
239238Coverage thresholds are enforced in ` package.json ` :
239+
240240- Branches: 70%
241241- Functions / Lines / Statements: 80%
242242
@@ -255,6 +255,7 @@ chore: upgrade dependencies
255255```
256256
257257Commits trigger automatic versioning via semantic-release:
258+
258259- ` fix ` → patch release
259260- ` feat ` → minor release
260261- ` feat ` with ` BREAKING CHANGE ` footer → major release
0 commit comments