diff --git a/.gitignore b/.gitignore index 7535671..e3eaaed 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ android/keystores/debug.keystore # generated by bob lib/ +src/manifest.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b477b1..aeddec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Add sdkVersions to connector API + ## [1.7.1] - 2024-09-11 ### Fixed diff --git a/manifest.js b/manifest.js new file mode 100755 index 0000000..e7629f2 --- /dev/null +++ b/manifest.js @@ -0,0 +1,6 @@ +const manifest = { + version: process.env.npm_package_version, + buildDate: new Date().toISOString(), +}; + +console.log(JSON.stringify(manifest)); diff --git a/package-lock.json b/package-lock.json index c178276..aea33fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "react": "^18.2.0", "react-native": "^0.74.5", "react-native-builder-bob": "^0.23.2", - "react-native-theoplayer": "^8.0.0", + "react-native-theoplayer": "^8.7.0", "typescript": "^5.6.2" }, "peerDependencies": { @@ -11402,9 +11402,9 @@ } }, "node_modules/react-native-theoplayer": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/react-native-theoplayer/-/react-native-theoplayer-8.0.0.tgz", - "integrity": "sha512-9CxR3Qi0Q0j6hP+CYVf0T9/t1OohKMjyKGgIq8Jn2p5Bjjz/cQxrNQyM2pK55q3iDXUTjXAn7ZO+scwZPeSXeA==", + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/react-native-theoplayer/-/react-native-theoplayer-8.7.0.tgz", + "integrity": "sha512-37DIxzbWlxxz5Co5hMqf7udUTw63g3E78YM6UxDylnawRE89gykrP+A+kcsP6g3vDVr64SF1dN4T8Sfr0/HX2g==", "dev": true, "dependencies": { "buffer": "^6.0.3" diff --git a/package.json b/package.json index 6449ec1..e1dcdce 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "prettier:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"", "lint": "eslint \"src/**/*.{ts,tsx}\"", "lint:fix": "npm run lint -- --fix", - "prepare": "bob build && husky" + "manifest": "node manifest.js > src/manifest.json", + "prepare": "npm run manifest && bob build && husky" }, "lint-staged": { "src/**/*.{js,jsx,ts,tsx}": [ @@ -70,7 +71,7 @@ "react": "^18.2.0", "react-native": "^0.74.5", "react-native-builder-bob": "^0.23.2", - "react-native-theoplayer": "^8.0.0", + "react-native-theoplayer": "^8.7.0", "typescript": "^5.6.2" }, "peerDependencies": { diff --git a/src/index.ts b/src/index.ts index fb1cc87..f97b9e9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,3 +13,4 @@ export * from './pallycon/PallyConFairplayContentProtectionIntegrationFactory'; export * from './keyos/KeyOSDrmFairplayContentProtectionIntegrationFactory'; export * from './keyos/KeyOSDrmWidevineContentProtectionIntegrationFactory'; export * from './keyos/KeyOSDrmPlayReadyContentProtectionIntegrationFactory'; +export { sdkVersions } from './version/Version'; diff --git a/src/version/Version.ts b/src/version/Version.ts new file mode 100644 index 0000000..b398023 --- /dev/null +++ b/src/version/Version.ts @@ -0,0 +1,9 @@ +import type { SdkVersions } from 'react-native-theoplayer'; +import * as manifest from '../manifest.json'; + +export const sdkVersions = async (): Promise => { + const rnVersionString = manifest.version ?? ''; + return { + rn: rnVersionString, + }; +};