react-native-ota-client 0.0.0-stage → 0.1.0

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.
Files changed (46) hide show
  1. package/LICENSE +20 -0
  2. package/OtaSdk.podspec +20 -0
  3. package/README.md +99 -2
  4. package/android/build.gradle +37 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/otasdk/OtaActivationPolicy.kt +74 -0
  7. package/android/src/main/java/com/otasdk/OtaBundleInstaller.kt +280 -0
  8. package/android/src/main/java/com/otasdk/OtaReleaseManifest.kt +187 -0
  9. package/android/src/main/java/com/otasdk/OtaSdkConfig.kt +22 -0
  10. package/android/src/main/java/com/otasdk/OtaSdkModule.kt +15 -0
  11. package/android/src/main/java/com/otasdk/OtaSdkPackage.kt +34 -0
  12. package/android/src/main/java/com/otasdk/OtaSdkUpdates.kt +51 -0
  13. package/android/src/main/java/com/otasdk/OtaUpdateManager.kt +384 -0
  14. package/android/src/main/java/com/otasdk/OtaUpdatesModule.kt +70 -0
  15. package/android/src/test/java/com/otasdk/OtaActivationPolicyTest.kt +47 -0
  16. package/android/src/test/java/com/otasdk/OtaReleaseManifestTest.kt +48 -0
  17. package/ios/OtaSdk.h +5 -0
  18. package/ios/OtaSdk.mm +21 -0
  19. package/lib/module/NativeOTAUpdates.js +5 -0
  20. package/lib/module/NativeOTAUpdates.js.map +1 -0
  21. package/lib/module/NativeOtaSdk.js +5 -0
  22. package/lib/module/NativeOtaSdk.js.map +1 -0
  23. package/lib/module/index.js +5 -0
  24. package/lib/module/index.js.map +1 -0
  25. package/lib/module/multiply.js +6 -0
  26. package/lib/module/multiply.js.map +1 -0
  27. package/lib/module/multiply.native.js +7 -0
  28. package/lib/module/multiply.native.js.map +1 -0
  29. package/lib/module/package.json +1 -0
  30. package/lib/typescript/package.json +1 -0
  31. package/lib/typescript/src/NativeOTAUpdates.d.ts +22 -0
  32. package/lib/typescript/src/NativeOTAUpdates.d.ts.map +1 -0
  33. package/lib/typescript/src/NativeOtaSdk.d.ts +7 -0
  34. package/lib/typescript/src/NativeOtaSdk.d.ts.map +1 -0
  35. package/lib/typescript/src/index.d.ts +4 -0
  36. package/lib/typescript/src/index.d.ts.map +1 -0
  37. package/lib/typescript/src/multiply.d.ts +2 -0
  38. package/lib/typescript/src/multiply.d.ts.map +1 -0
  39. package/lib/typescript/src/multiply.native.d.ts +2 -0
  40. package/lib/typescript/src/multiply.native.d.ts.map +1 -0
  41. package/package.json +181 -4
  42. package/src/NativeOTAUpdates.ts +24 -0
  43. package/src/NativeOtaSdk.ts +7 -0
  44. package/src/index.tsx +6 -0
  45. package/src/multiply.native.tsx +5 -0
  46. package/src/multiply.tsx +3 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeOtaSdk.d.ts","sourceRoot":"","sources":["../../../src/NativeOtaSdk.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,wBAAgE"}
@@ -0,0 +1,4 @@
1
+ export { multiply } from './multiply';
2
+ export { default as OTAUpdates } from './NativeOTAUpdates.js';
3
+ export type { OtaUpdateStatus, Spec as OtaUpdatesSpec, } from './NativeOTAUpdates.js';
4
+ //# 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;AACtC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAoB,CAAC;AAC3D,YAAY,EACV,eAAe,EACf,IAAI,IAAI,cAAc,GACvB,MAAM,uBAAoB,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 CHANGED
@@ -1,6 +1,183 @@
1
1
  {
2
2
  "name": "react-native-ota-client",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Android over-the-air JavaScript updates for React Native applications",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "react-native-ota-client-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-ota-client-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
+ },
43
+ "keywords": [
44
+ "react-native",
45
+ "android"
46
+ ],
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/arjunnarangali/react-native-ota-client.git"
50
+ },
51
+ "author": "boyka <arjunnarangali2@gmail.com> (https://arjunis.me/)",
52
+ "license": "MIT",
53
+ "bugs": {
54
+ "url": "https://github.com/arjunnarangali/react-native-ota-client/issues"
55
+ },
56
+ "homepage": "https://github.com/arjunnarangali/react-native-ota-client#readme",
57
+ "publishConfig": {
58
+ "registry": "https://registry.npmjs.org/"
59
+ },
60
+ "devDependencies": {
61
+ "@commitlint/config-conventional": "^21.2.4",
62
+ "@eslint/compat": "^2.1.1",
63
+ "@eslint/eslintrc": "^3.3.7",
64
+ "@eslint/js": "^9.39.5",
65
+ "@jest/globals": "^29.7.0",
66
+ "@react-native/babel-preset": "0.88.0",
67
+ "@react-native/eslint-config": "0.88.0",
68
+ "@react-native/jest-preset": "0.88.0",
69
+ "@release-it/conventional-changelog": "^12.0.2",
70
+ "@types/react": "^19.2.0",
71
+ "commitlint": "^21.2.4",
72
+ "del-cli": "^8.0.1",
73
+ "eslint": "^9.39.5",
74
+ "eslint-config-prettier": "^10.1.8",
75
+ "eslint-plugin-ft-flow": "^3.0.11",
76
+ "eslint-plugin-prettier": "^5.5.7",
77
+ "jest": "^29.7.0",
78
+ "lefthook": "^2.2.2",
79
+ "prettier": "^3.9.10",
80
+ "react": "19.3.0",
81
+ "react-native": "0.88.0",
82
+ "react-native-builder-bob": "^0.44.1",
83
+ "release-it": "^21.1.1",
84
+ "turbo": "^2.11.10",
85
+ "typescript": "^6.0.3"
86
+ },
87
+ "peerDependencies": {
88
+ "react": "*",
89
+ "react-native": "^0.88.0"
90
+ },
91
+ "workspaces": [
92
+ "example"
93
+ ],
94
+ "packageManager": "yarn@4.18.1",
95
+ "react-native-builder-bob": {
96
+ "source": "src",
97
+ "output": "lib",
98
+ "targets": [
99
+ [
100
+ "module",
101
+ {
102
+ "esm": true
103
+ }
104
+ ],
105
+ [
106
+ "typescript",
107
+ {
108
+ "project": "tsconfig.build.json"
109
+ }
110
+ ]
111
+ ]
112
+ },
113
+ "codegenConfig": {
114
+ "name": "OtaSdkSpec",
115
+ "type": "modules",
116
+ "jsSrcsDir": "src",
117
+ "android": {
118
+ "javaPackageName": "com.otasdk"
119
+ }
120
+ },
121
+ "prettier": {
122
+ "quoteProps": "consistent",
123
+ "singleQuote": true,
124
+ "tabWidth": 2,
125
+ "trailingComma": "es5",
126
+ "useTabs": false
127
+ },
128
+ "jest": {
129
+ "preset": "@react-native/jest-preset",
130
+ "testEnvironmentOptions": {
131
+ "customExportConditions": [
132
+ "require",
133
+ "react-native",
134
+ "react-native-ota-client-source"
135
+ ]
136
+ },
137
+ "modulePathIgnorePatterns": [
138
+ "<rootDir>/example/node_modules",
139
+ "<rootDir>/lib/"
140
+ ]
141
+ },
142
+ "commitlint": {
143
+ "extends": [
144
+ "@commitlint/config-conventional"
145
+ ]
146
+ },
147
+ "dependenciesMeta": {
148
+ "lefthook": {
149
+ "built": true
150
+ }
151
+ },
152
+ "release-it": {
153
+ "git": {
154
+ "commitMessage": "chore: release ${version}",
155
+ "tagName": "v${version}"
156
+ },
157
+ "npm": {
158
+ "publish": true
159
+ },
160
+ "github": {
161
+ "release": true
162
+ },
163
+ "plugins": {
164
+ "@release-it/conventional-changelog": {
165
+ "preset": {
166
+ "name": "angular"
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "create-react-native-library": {
172
+ "type": "turbo-module",
173
+ "languages": "kotlin-objc",
174
+ "tools": [
175
+ "eslint",
176
+ "jest",
177
+ "lefthook",
178
+ "release-it",
179
+ "vite"
180
+ ],
181
+ "version": "0.64.0"
182
+ }
183
+ }
@@ -0,0 +1,24 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export type OtaUpdateStatus = {
5
+ enabled: boolean;
6
+ status: string;
7
+ message: string;
8
+ runtimeVersion: string;
9
+ channel: string;
10
+ currentVersion: number;
11
+ pendingVersion: number | null;
12
+ pendingRestart: boolean;
13
+ updateAvailable: boolean;
14
+ action: string | null;
15
+ };
16
+
17
+ export interface Spec extends TurboModule {
18
+ getStatus(): Promise<OtaUpdateStatus>;
19
+ checkForUpdate(): Promise<OtaUpdateStatus>;
20
+ markUpdateSuccessful(): Promise<OtaUpdateStatus>;
21
+ closeAppToApplyUpdate(): Promise<boolean>;
22
+ }
23
+
24
+ export default TurboModuleRegistry.getEnforcing<Spec>('OTAUpdates');
@@ -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>('OtaSdk');
package/src/index.tsx ADDED
@@ -0,0 +1,6 @@
1
+ export { multiply } from './multiply';
2
+ export { default as OTAUpdates } from './NativeOTAUpdates';
3
+ export type {
4
+ OtaUpdateStatus,
5
+ Spec as OtaUpdatesSpec,
6
+ } from './NativeOTAUpdates';
@@ -0,0 +1,5 @@
1
+ import OtaSdk from './NativeOtaSdk';
2
+
3
+ export function multiply(a: number, b: number): number {
4
+ return OtaSdk.multiply(a, b);
5
+ }
@@ -0,0 +1,3 @@
1
+ export function multiply(a: number, b: number): number {
2
+ return a * b;
3
+ }