@santoshrd/react-native-demo-package 1.0.2

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.
@@ -0,0 +1,20 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "DemoPackage"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => min_ios_version_supported }
14
+ s.source = { :git => "https://github.com/santoshgistto/react-native-demo-package.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
17
+ s.private_header_files = "ios/**/*.h"
18
+
19
+ install_modules_dependencies(s)
20
+ end
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Santosh Dandu
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # react-native-demo-package
2
+
3
+ just for demonstration purpose
4
+
5
+ ## Installation
6
+
7
+
8
+ ```sh
9
+ npm install react-native-demo-package
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+
16
+ ```js
17
+ import { multiply } from 'react-native-demo-package';
18
+
19
+ // ...
20
+
21
+ const result = multiply(3, 7);
22
+ ```
23
+
24
+
25
+ ## Contributing
26
+
27
+ - [Development workflow](CONTRIBUTING.md#development-workflow)
28
+ - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
29
+ - [Code of conduct](CODE_OF_CONDUCT.md)
30
+
31
+ ## License
32
+
33
+ MIT
34
+
35
+ ---
36
+
37
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
@@ -0,0 +1,67 @@
1
+ buildscript {
2
+ ext.DemoPackage = [
3
+ kotlinVersion: "2.0.21",
4
+ minSdkVersion: 24,
5
+ compileSdkVersion: 36,
6
+ targetSdkVersion: 36
7
+ ]
8
+
9
+ ext.getExtOrDefault = { prop ->
10
+ if (rootProject.ext.has(prop)) {
11
+ return rootProject.ext.get(prop)
12
+ }
13
+
14
+ return DemoPackage[prop]
15
+ }
16
+
17
+ repositories {
18
+ google()
19
+ mavenCentral()
20
+ }
21
+
22
+ dependencies {
23
+ classpath "com.android.tools.build:gradle:8.7.2"
24
+ // noinspection DifferentKotlinGradleVersion
25
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
26
+ }
27
+ }
28
+
29
+
30
+ apply plugin: "com.android.library"
31
+ apply plugin: "kotlin-android"
32
+
33
+ apply plugin: "com.facebook.react"
34
+
35
+ android {
36
+ namespace "com.demopackage"
37
+
38
+ compileSdkVersion getExtOrDefault("compileSdkVersion")
39
+
40
+ defaultConfig {
41
+ minSdkVersion getExtOrDefault("minSdkVersion")
42
+ targetSdkVersion getExtOrDefault("targetSdkVersion")
43
+ }
44
+
45
+ buildFeatures {
46
+ buildConfig true
47
+ }
48
+
49
+ buildTypes {
50
+ release {
51
+ minifyEnabled false
52
+ }
53
+ }
54
+
55
+ lint {
56
+ disable "GradleCompatible"
57
+ }
58
+
59
+ compileOptions {
60
+ sourceCompatibility JavaVersion.VERSION_1_8
61
+ targetCompatibility JavaVersion.VERSION_1_8
62
+ }
63
+ }
64
+
65
+ dependencies {
66
+ implementation "com.facebook.react:react-android"
67
+ }
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,15 @@
1
+ package com.demopackage
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+
5
+ class DemoPackageModule(reactContext: ReactApplicationContext) :
6
+ NativeDemoPackageSpec(reactContext) {
7
+
8
+ override fun multiply(a: Double, b: Double): Double {
9
+ return a * b
10
+ }
11
+
12
+ companion object {
13
+ const val NAME = NativeDemoPackageSpec.NAME
14
+ }
15
+ }
@@ -0,0 +1,31 @@
1
+ package com.demopackage
2
+
3
+ import com.facebook.react.BaseReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.module.model.ReactModuleInfo
7
+ import com.facebook.react.module.model.ReactModuleInfoProvider
8
+ import java.util.HashMap
9
+
10
+ class DemoPackagePackage : BaseReactPackage() {
11
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
12
+ return if (name == DemoPackageModule.NAME) {
13
+ DemoPackageModule(reactContext)
14
+ } else {
15
+ null
16
+ }
17
+ }
18
+
19
+ override fun getReactModuleInfoProvider() = ReactModuleInfoProvider {
20
+ mapOf(
21
+ DemoPackageModule.NAME to ReactModuleInfo(
22
+ name = DemoPackageModule.NAME,
23
+ className = DemoPackageModule.NAME,
24
+ canOverrideExistingModule = false,
25
+ needsEagerInit = false,
26
+ isCxxModule = false,
27
+ isTurboModule = true
28
+ )
29
+ )
30
+ }
31
+ }
@@ -0,0 +1,5 @@
1
+ #import <DemoPackageSpec/DemoPackageSpec.h>
2
+
3
+ @interface DemoPackage : NSObject <NativeDemoPackageSpec>
4
+
5
+ @end
@@ -0,0 +1,21 @@
1
+ #import "DemoPackage.h"
2
+
3
+ @implementation DemoPackage
4
+ - (NSNumber *)multiply:(double)a b:(double)b {
5
+ NSNumber *result = @(a * b);
6
+
7
+ return result;
8
+ }
9
+
10
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
11
+ (const facebook::react::ObjCTurboModule::InitParams &)params
12
+ {
13
+ return std::make_shared<facebook::react::NativeDemoPackageSpecJSI>(params);
14
+ }
15
+
16
+ + (NSString *)moduleName
17
+ {
18
+ return @"DemoPackage";
19
+ }
20
+
21
+ @end
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ import { TurboModuleRegistry } from 'react-native';
4
+ export default TurboModuleRegistry.getEnforcing('DemoPackage');
5
+ //# sourceMappingURL=NativeDemoPackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeDemoPackage.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AAMpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,aAAa,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { multiply } from './multiply';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["multiply"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,YAAY","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ export function multiply(a, b) {
4
+ return a * b;
5
+ }
6
+ //# sourceMappingURL=multiply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["multiply","a","b"],"sourceRoot":"../../src","sources":["multiply.tsx"],"mappings":";;AAAA,OAAO,SAASA,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACrD,OAAOD,CAAC,GAAGC,CAAC;AACd","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ import DemoPackage from "./NativeDemoPackage.js";
4
+ export function multiply(a, b) {
5
+ return DemoPackage.multiply(a, b);
6
+ }
7
+ //# sourceMappingURL=multiply.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DemoPackage","multiply","a","b"],"sourceRoot":"../../src","sources":["multiply.native.tsx"],"mappings":";;AAAA,OAAOA,WAAW,MAAM,wBAAqB;AAE7C,OAAO,SAASC,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACrD,OAAOH,WAAW,CAACC,QAAQ,CAACC,CAAC,EAAEC,CAAC,CAAC;AACnC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,7 @@
1
+ import { type TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ multiply(a: number, b: number): number;
4
+ }
5
+ declare const _default: Spec;
6
+ export default _default;
7
+ //# sourceMappingURL=NativeDemoPackage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeDemoPackage.d.ts","sourceRoot":"","sources":["../../../src/NativeDemoPackage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxC;;AAED,wBAAqE"}
@@ -0,0 +1,2 @@
1
+ export { multiply } from './multiply';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function multiply(a: number, b: number): number;
2
+ //# sourceMappingURL=multiply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multiply.d.ts","sourceRoot":"","sources":["../../../src/multiply.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -0,0 +1,2 @@
1
+ export declare function multiply(a: number, b: number): number;
2
+ //# sourceMappingURL=multiply.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multiply.native.d.ts","sourceRoot":"","sources":["../../../src/multiply.native.tsx"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD"}
package/package.json ADDED
@@ -0,0 +1,175 @@
1
+ {
2
+ "name": "@santoshrd/react-native-demo-package",
3
+ "version": "1.0.2",
4
+ "description": "just for demonstration purpose ",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace react-native-demo-package-example",
36
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
37
+ "prepare": "bob build",
38
+ "typecheck": "tsc",
39
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
40
+ "test": "jest",
41
+ "release": "release-it --only-version",
42
+ "web": "vite",
43
+ "build:web": "vite build"
44
+ },
45
+ "keywords": [
46
+ "react-native",
47
+ "ios",
48
+ "android"
49
+ ],
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/santoshgistto/react-native-demo-package.git"
53
+ },
54
+ "author": "Santosh Dandu <santosh.gistto@gmail.com> (https://github.com/santoshgistto)",
55
+ "license": "MIT",
56
+ "bugs": {
57
+ "url": "https://github.com/santoshgistto/react-native-demo-package/issues"
58
+ },
59
+ "homepage": "https://github.com/santoshgistto/react-native-demo-package#readme",
60
+ "publishConfig": {
61
+ "registry": "https://registry.npmjs.org/"
62
+ },
63
+ "devDependencies": {
64
+ "@commitlint/config-conventional": "^20.5.0",
65
+ "@eslint/compat": "^2.0.3",
66
+ "@eslint/eslintrc": "^3.3.5",
67
+ "@eslint/js": "^10.0.1",
68
+ "@jest/globals": "^30.0.0",
69
+ "@react-native/babel-preset": "0.85.0",
70
+ "@react-native/eslint-config": "0.85.0",
71
+ "@react-native/jest-preset": "0.85.0",
72
+ "@release-it/conventional-changelog": "^10.0.6",
73
+ "@types/react": "^19.2.0",
74
+ "commitlint": "^20.5.0",
75
+ "del-cli": "^7.0.0",
76
+ "eslint": "^9.39.4",
77
+ "eslint-config-prettier": "^10.1.8",
78
+ "eslint-plugin-ft-flow": "^3.0.11",
79
+ "eslint-plugin-prettier": "^5.5.5",
80
+ "jest": "^30.3.0",
81
+ "lefthook": "^2.1.4",
82
+ "prettier": "^3.8.1",
83
+ "react": "19.2.3",
84
+ "react-native": "0.85.0",
85
+ "react-native-builder-bob": "^0.41.0",
86
+ "react-native-web": "~0.21.1",
87
+ "release-it": "^19.2.4",
88
+ "turbo": "^2.8.21",
89
+ "typescript": "^6.0.2"
90
+ },
91
+ "peerDependencies": {
92
+ "react": "*",
93
+ "react-native": "*"
94
+ },
95
+ "workspaces": [
96
+ "example"
97
+ ],
98
+ "packageManager": "yarn@4.11.0",
99
+ "react-native-builder-bob": {
100
+ "source": "src",
101
+ "output": "lib",
102
+ "targets": [
103
+ [
104
+ "module",
105
+ {
106
+ "esm": true
107
+ }
108
+ ],
109
+ [
110
+ "typescript",
111
+ {
112
+ "project": "tsconfig.build.json"
113
+ }
114
+ ]
115
+ ]
116
+ },
117
+ "codegenConfig": {
118
+ "name": "DemoPackageSpec",
119
+ "type": "modules",
120
+ "jsSrcsDir": "src",
121
+ "android": {
122
+ "javaPackageName": "com.demopackage"
123
+ }
124
+ },
125
+ "prettier": {
126
+ "quoteProps": "consistent",
127
+ "singleQuote": true,
128
+ "tabWidth": 2,
129
+ "trailingComma": "es5",
130
+ "useTabs": false
131
+ },
132
+ "jest": {
133
+ "preset": "@react-native/jest-preset",
134
+ "modulePathIgnorePatterns": [
135
+ "<rootDir>/example/node_modules",
136
+ "<rootDir>/lib/"
137
+ ]
138
+ },
139
+ "commitlint": {
140
+ "extends": [
141
+ "@commitlint/config-conventional"
142
+ ]
143
+ },
144
+ "release-it": {
145
+ "git": {
146
+ "commitMessage": "chore: release ${version}",
147
+ "tagName": "v${version}"
148
+ },
149
+ "npm": {
150
+ "publish": true
151
+ },
152
+ "github": {
153
+ "release": true
154
+ },
155
+ "plugins": {
156
+ "@release-it/conventional-changelog": {
157
+ "preset": {
158
+ "name": "angular"
159
+ }
160
+ }
161
+ }
162
+ },
163
+ "create-react-native-library": {
164
+ "type": "turbo-module",
165
+ "languages": "kotlin-objc",
166
+ "tools": [
167
+ "eslint",
168
+ "jest",
169
+ "lefthook",
170
+ "release-it",
171
+ "vite"
172
+ ],
173
+ "version": "0.62.0"
174
+ }
175
+ }
@@ -0,0 +1,7 @@
1
+ import { TurboModuleRegistry, type TurboModule } from 'react-native';
2
+
3
+ export interface Spec extends TurboModule {
4
+ multiply(a: number, b: number): number;
5
+ }
6
+
7
+ export default TurboModuleRegistry.getEnforcing<Spec>('DemoPackage');
package/src/index.tsx ADDED
@@ -0,0 +1 @@
1
+ export { multiply } from './multiply';
@@ -0,0 +1,5 @@
1
+ import DemoPackage from './NativeDemoPackage';
2
+
3
+ export function multiply(a: number, b: number): number {
4
+ return DemoPackage.multiply(a, b);
5
+ }
@@ -0,0 +1,3 @@
1
+ export function multiply(a: number, b: number): number {
2
+ return a * b;
3
+ }