@themobilefirstcompany/react-native-data-detector 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +83 -0
- package/README.md +8 -2
- package/android/build.gradle +1 -1
- package/package.json +4 -4
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to `react-native-data-detector`! This guide will help you get started.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js 18+
|
|
8
|
+
- Xcode 15+ (for iOS development)
|
|
9
|
+
- Android Studio (for Android development)
|
|
10
|
+
- CocoaPods
|
|
11
|
+
|
|
12
|
+
## Getting Started
|
|
13
|
+
|
|
14
|
+
1. Fork and clone the repository:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git clone https://github.com/<your-username>/react-native-data-detector.git
|
|
18
|
+
cd react-native-data-detector
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. Install dependencies:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Project Structure
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
src/ # TypeScript source (module API and types)
|
|
31
|
+
ios/ # iOS native code (Swift, NSDataDetector)
|
|
32
|
+
android/ # Android native code (Kotlin, ML Kit)
|
|
33
|
+
example/ # Expo example app for manual testing
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Running the Example App
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cd example
|
|
40
|
+
npm install
|
|
41
|
+
npx pod-install
|
|
42
|
+
npx expo run:ios # or npx expo run:android
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Development Workflow
|
|
46
|
+
|
|
47
|
+
- **TypeScript changes** — edit files in `src/`, then run `npm run build`.
|
|
48
|
+
- **Native changes** — edit `ios/` or `android/`, then rebuild the example app.
|
|
49
|
+
|
|
50
|
+
## Available Scripts
|
|
51
|
+
|
|
52
|
+
| Script | Description |
|
|
53
|
+
| --------------- | ---------------------------------- |
|
|
54
|
+
| `npm run build` | TypeScript typecheck and compile |
|
|
55
|
+
| `npm run lint` | Lint the codebase |
|
|
56
|
+
| `npm run test` | Run tests |
|
|
57
|
+
| `npm run clean` | Remove build artifacts |
|
|
58
|
+
|
|
59
|
+
## Commit Convention
|
|
60
|
+
|
|
61
|
+
This project follows [Conventional Commits](https://www.conventionalcommits.org/):
|
|
62
|
+
|
|
63
|
+
- `feat:` — new feature
|
|
64
|
+
- `fix:` — bug fix
|
|
65
|
+
- `docs:` — documentation only
|
|
66
|
+
- `chore:` — maintenance, dependencies
|
|
67
|
+
- `refactor:` — code change that neither fixes a bug nor adds a feature
|
|
68
|
+
- `test:` — adding or updating tests
|
|
69
|
+
|
|
70
|
+
## Pull Request Process
|
|
71
|
+
|
|
72
|
+
1. Branch from `main`.
|
|
73
|
+
2. Make your changes and ensure all checks pass (`lint`, `build`, `test`).
|
|
74
|
+
3. Fill out the [PR template](.github/PULL_REQUEST_TEMPLATE.md).
|
|
75
|
+
4. Submit your PR against `main`.
|
|
76
|
+
|
|
77
|
+
## Code of Conduct
|
|
78
|
+
|
|
79
|
+
This project is governed by the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
|
|
80
|
+
|
|
81
|
+
## Reporting Bugs & Requesting Features
|
|
82
|
+
|
|
83
|
+
Please use the [issue templates](https://github.com/themobilefirstco/react-native-data-detector/issues/new/choose) when opening an issue.
|
package/README.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# react-native-data-detector
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@themobilefirstcompany/react-native-data-detector)
|
|
4
|
+
|
|
3
5
|
Cross-platform text data detection for React Native. Uses **NSDataDetector** on iOS and **ML Kit Entity Extraction** on Android to detect phone numbers, URLs, emails, dates, and addresses — returning structured results to JavaScript.
|
|
4
6
|
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="data-detector.png" alt="Data Detector Example" width="500" />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
5
11
|
## Features
|
|
6
12
|
|
|
7
13
|
- **Phone numbers** — Detect and extract phone numbers
|
|
@@ -15,7 +21,7 @@ Cross-platform text data detection for React Native. Uses **NSDataDetector** on
|
|
|
15
21
|
## Installation
|
|
16
22
|
|
|
17
23
|
```bash
|
|
18
|
-
npm install react-native-data-detector
|
|
24
|
+
npm install @themobilefirstcompany/react-native-data-detector
|
|
19
25
|
```
|
|
20
26
|
|
|
21
27
|
### iOS
|
|
@@ -31,7 +37,7 @@ The ML Kit entity extraction model (~5.6MB) is downloaded on the user's device a
|
|
|
31
37
|
## Usage
|
|
32
38
|
|
|
33
39
|
```typescript
|
|
34
|
-
import { detect, downloadModel } from 'react-native-data-detector';
|
|
40
|
+
import { detect, downloadModel } from '@themobilefirstcompany/react-native-data-detector';
|
|
35
41
|
|
|
36
42
|
// Pre-download the ML Kit model at app startup (Android only, no-op on iOS)
|
|
37
43
|
await downloadModel();
|
package/android/build.gradle
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themobilefirstcompany/react-native-data-detector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Cross-platform text data detection for React Native. Uses NSDataDetector on iOS and ML Kit Entity Extraction on Android to detect phone numbers, URLs, emails, dates, and addresses.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"address",
|
|
16
16
|
"date"
|
|
17
17
|
],
|
|
18
|
-
"homepage": "https://github.com/
|
|
18
|
+
"homepage": "https://github.com/themobilefirstco/react-native-data-detector#readme",
|
|
19
19
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/
|
|
20
|
+
"url": "https://github.com/themobilefirstco/react-native-data-detector/issues"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/
|
|
24
|
+
"url": "git+https://github.com/themobilefirstco/react-native-data-detector.git"
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"author": "pablogdcr",
|