From 8710bc7a7fd983dbd2774dc17fa464cd0cf624c0 Mon Sep 17 00:00:00 2001 From: mansi-dev Date: Thu, 29 Jan 2026 22:48:20 +0530 Subject: [PATCH] Add initial implementation of Map SDK and example app - Create README for the main repository and example app - Implement example app with MapView and Marker components - Add package.json for example app with necessary scripts and dependencies - Create Map SDK package with TypeScript wrapper around react-native-maps - Define TypeScript configuration for the SDK --- README.md | 11 +++++++++++ example/App.tsx | 21 ++++++++++++++++++++ example/README.md | 15 +++++++++++++++ example/package.json | 16 ++++++++++++++++ package.json | 13 +++++++++++++ packages/map-sdk/README.md | 33 ++++++++++++++++++++++++++++++++ packages/map-sdk/package.json | 25 ++++++++++++++++++++++++ packages/map-sdk/src/MapView.tsx | 10 ++++++++++ packages/map-sdk/src/index.ts | 2 ++ packages/map-sdk/tsconfig.json | 15 +++++++++++++++ 10 files changed, 161 insertions(+) create mode 100644 README.md create mode 100644 example/App.tsx create mode 100644 example/README.md create mode 100644 example/package.json create mode 100644 package.json create mode 100644 packages/map-sdk/README.md create mode 100644 packages/map-sdk/package.json create mode 100644 packages/map-sdk/src/MapView.tsx create mode 100644 packages/map-sdk/src/index.ts create mode 100644 packages/map-sdk/tsconfig.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..b793a74 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Map SDK Monorepo + +This repository contains a TypeScript wrapper package (`@lynkedup/map-sdk`) that builds on `react-native-maps`, plus an `example` React Native app demonstrating usage. + +Quick commands: + +- Install deps: `npm run bootstrap` +- Build SDK: `npm run build` +- Start example: `npm run start:example` + +See package READMEs for platform-specific setup (iOS/Android) and usage notes. diff --git a/example/App.tsx b/example/App.tsx new file mode 100644 index 0000000..6c4be99 --- /dev/null +++ b/example/App.tsx @@ -0,0 +1,21 @@ +import React from 'react'; +import { SafeAreaView, StyleSheet } from 'react-native'; +import { MapView, Marker } from '@lynkedup/map-sdk'; + +export default function App() { + return ( + + + + + + ); +} + +const styles = StyleSheet.create({ + container: { flex: 1 }, + map: { flex: 1 } +}); diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..3b1f330 --- /dev/null +++ b/example/README.md @@ -0,0 +1,15 @@ +# Example App + +This example demonstrates usage of `@lynkedup/map-sdk`. + +Setup: + +1. From repo root run `npm run bootstrap` to install workspace packages. +2. From `example` run `npm install` to install native deps. +3. iOS: run `npx pod-install ios` and add your Google Maps API key if you use Google provider. +4. Android: ensure Google Play services and API keys are set in `AndroidManifest.xml` if using Google maps. + +Run: +- `npm run ios` or `npm run android` from `example` folder. + +See `react-native-maps` docs for platform-specific instructions: https://github.com/react-native-maps/react-native-maps diff --git a/example/package.json b/example/package.json new file mode 100644 index 0000000..d022e91 --- /dev/null +++ b/example/package.json @@ -0,0 +1,16 @@ +{ + "name": "example", + "private": true, + "version": "0.0.1", + "scripts": { + "start": "react-native start", + "ios": "react-native run-ios", + "android": "react-native run-android" + }, + "dependencies": { + "react": "18.2.0", + "react-native": "0.71.0", + "react-native-maps": "^1.3.2", + "@lynkedup/map-sdk": "*" + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..94c4938 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "mapsdk-monorepo", + "private": true, + "workspaces": [ + "packages/*", + "example" + ], + "scripts": { + "bootstrap": "npm install", + "build": "npm run -w @lynkedup/map-sdk build", + "start:example": "npm run -w example start" + } +} \ No newline at end of file diff --git a/packages/map-sdk/README.md b/packages/map-sdk/README.md new file mode 100644 index 0000000..da69a1c --- /dev/null +++ b/packages/map-sdk/README.md @@ -0,0 +1,33 @@ +# @lynkedup/map-sdk + +A small TypeScript wrapper around `react-native-maps` to provide a consistent API and typed components. + +## Usage + +Install peer deps in your app: + +``` +npm install react-native react-native-maps +# and add this package via workspace or npm/yarn +``` + +Basic usage: + +```ts +import React from 'react'; +import { MapView, Marker } from '@lynkedup/map-sdk'; + +export default function App() { + return ( + + + + ); +} +``` + +## Notes +- This package delegates to `react-native-maps` for platform implementations. Follow `react-native-maps` docs for iOS/Android setup (Google Maps API key, pods, manifest permissions). diff --git a/packages/map-sdk/package.json b/packages/map-sdk/package.json new file mode 100644 index 0000000..bf4068a --- /dev/null +++ b/packages/map-sdk/package.json @@ -0,0 +1,25 @@ +{ + "name": "@lynkedup/map-sdk", + "version": "0.1.0", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "license": "MIT", + "files": [ + "dist" + ], + "scripts": { + "build": "tsc -p tsconfig.json", + "lint": "eslint . --ext .ts,.tsx" + }, + "peerDependencies": { + "react": ">=17", + "react-native": ">=0.70", + "react-native-maps": "^1.3.2" + }, + "devDependencies": { + "typescript": "^5.0.0", + "eslint": "^8.0.0", + "@types/react": "^18.0.0", + "@types/react-native": "^0.70.0" + } +} \ No newline at end of file diff --git a/packages/map-sdk/src/MapView.tsx b/packages/map-sdk/src/MapView.tsx new file mode 100644 index 0000000..9ba6eee --- /dev/null +++ b/packages/map-sdk/src/MapView.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import RNMapView, { MapViewProps as RNMapViewProps } from 'react-native-maps'; + +export type MapProps = RNMapViewProps; + +const MapView: React.FC = (props) => { + return {props.children}; +}; + +export default MapView; diff --git a/packages/map-sdk/src/index.ts b/packages/map-sdk/src/index.ts new file mode 100644 index 0000000..a7c951d --- /dev/null +++ b/packages/map-sdk/src/index.ts @@ -0,0 +1,2 @@ +export { default as MapView } from './MapView'; +export { Marker, Polyline, PROVIDER_GOOGLE } from 'react-native-maps'; diff --git a/packages/map-sdk/tsconfig.json b/packages/map-sdk/tsconfig.json new file mode 100644 index 0000000..8a16768 --- /dev/null +++ b/packages/map-sdk/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "jsx": "react", + "declaration": true, + "outDir": "dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file