diff --git a/README.md b/README.md index 55bbad3..28ea9e1 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,20 @@ This plugin contains support for Amazon Vega as a platform for React Native apps Install the dependencies for this package: -`npm install react-native-uuid @amazon-devices/react-native-device-info @segment/analytics-react-native@beta` +``` +npm install react-native-uuid \ + @amazon-devices/react-native-device-info@2.1.9000000000-rn-83 \ + @amazon-devices/react-native-localize@2.1.9000000000-rn-83 \ + "@react-native-async-storage/async-storage@npm:@amazon-devices/react-native-async-storage__async-storage@2.1.9000000000-rn-83" \ + @segment/analytics-react-native +``` -Then install this package from npm registry +Then install this package from npm registry: `npm install @segment/analytics-react-native-plugin-kepler` +> **React Native 0.83 / Vega SDK 0.24:** Use plugin version `^2.0.0`. If your app is still on RN 0.72 / Vega SDK ≤0.19, pin to plugin version `^1.0.0`. + Now create you client as follows: ```ts diff --git a/babel.config.js b/babel.config.js index f842b77..f7b3da3 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: ['module:metro-react-native-babel-preset'], + presets: ['module:@react-native/babel-preset'], }; diff --git a/example/babel.config.js b/example/babel.config.js index c1cff7c..1010e95 100644 --- a/example/babel.config.js +++ b/example/babel.config.js @@ -4,5 +4,5 @@ * PROPRIETARY/CONFIDENTIAL. USE IS SUBJECT TO LICENSE TERMS. */ module.exports = { - presets: ['module:metro-react-native-babel-preset'], + presets: ['module:@react-native/babel-preset'], }; diff --git a/example/package.json b/example/package.json index 7ce6fea..eea58c3 100644 --- a/example/package.json +++ b/example/package.json @@ -16,37 +16,42 @@ "release": "npm-run-all lint test compile" }, "dependencies": { - "@amazon-devices/react-native-device-info": "^2.0.0", - "@amazon-devices/react-native-kepler": "~2.0.0", + "@amazon-devices/react-native-device-info": "2.1.9000000000-rn-83", + "@amazon-devices/react-native-kepler": "4.0.0", + "@amazon-devices/react-native-localize": "2.1.9000000000-rn-83", + "@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@2.1.9000000000-rn-83", "@segment/analytics-react-native": "2.20.0-beta.2", - "@segment/analytics-react-native-plugin-kepler": "^0", - "react": "18.2.0", - "react-native": "0.72.0", + "@segment/analytics-react-native-plugin-kepler": "^2.0.0", + "react": "18.3.1", + "react-native": "0.83.0", "react-native-uuid": "^2.0.2" }, + "overrides": { + "@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@2.1.9000000000-rn-83" + }, "devDependencies": { - "@amazon-devices/kepler-cli-platform": "^0", - "@babel/core": "^7.20.0", - "@babel/runtime": "^7.20.0", - "@babel/traverse": "7.22.8", - "@react-native-community/cli": "11.3.2", - "@react-native/eslint-config": "0.72.2", - "@react-native/metro-config": "^0.72.6", - "@testing-library/react-native": "^7.2.0", - "@types/jest": "^28.0.0", - "@types/react": "^18.0.24", - "@types/react-test-renderer": "^18.0.0", - "@typescript-eslint/eslint-plugin": "^5.30.0", - "babel-jest": "^28.0.0", - "eslint": "^8.12.0", - "jest": "^28.0.0", - "metro-react-native-babel-preset": "^0.76.5", + "@amazon-devices/kepler-cli-platform": "^0.24.0", + "@babel/core": "^7.23.0", + "@babel/runtime": "^7.23.0", + "@babel/traverse": "^7.23.0", + "@react-native-community/cli": "^14.0.0", + "@react-native/babel-preset": "^0.83.0", + "@react-native/eslint-config": "^0.83.0", + "@react-native/metro-config": "^0.83.0", + "@testing-library/react-native": "^12.0.0", + "@types/jest": "^29.5.0", + "@types/react": "^18.3.0", + "@types/react-test-renderer": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^6.0.0", + "babel-jest": "^29.7.0", + "eslint": "^8.56.0", + "jest": "^29.7.0", "mustache": "^4.2.0", "npm-run-all": "^4.1.5", - "prettier": "^2.6.2", - "react-test-renderer": "18.2.0", - "ts-jest": "^28.0.0", - "typescript": "4.8.4" + "prettier": "^2.8.8", + "react-test-renderer": "18.3.1", + "ts-jest": "^29.1.0", + "typescript": "5.0.4" }, "kepler": { "projectType": "application", diff --git a/jest.config.js b/jest.config.js index 2fc0c4c..449770b 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,9 @@ -const baseConfig = require('@segment/analytics-rn-shared/jest.config.base'); - module.exports = { - ...baseConfig, + preset: 'ts-jest', + testEnvironment: 'node', + roots: ['/src'], + testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'], + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, }; diff --git a/package.json b/package.json index 6197852..5f57732 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "@segment/analytics-react-native-plugin-kepler", "private": false, - "version": "1.0.0", + "version": "2.0.0", "description": "The hassle-free way to add Segment analytics to your React-Native app for Amazon Kepler", "main": "lib/commonjs/index", "scripts": { "build": "bob build", - "test": "jest", + "test": "jest --passWithNoTests", "typescript": "tsc --noEmit", "clean": "rimraf lib node_modules" }, @@ -45,17 +45,17 @@ }, "homepage": "https://github.com/segmentio/analytics-react-native/tree/master/packages/plugins/plugin-amplitudeSession#readme", "peerDependencies": { - "@amazon-devices/react-native-device-info": "^2.0.0", - "@amazon-devices/react-native-kepler": "~2.0.0", + "@amazon-devices/react-native-device-info": "2.1.9000000000-rn-83", + "@amazon-devices/react-native-kepler": "4.0.0", "@segment/analytics-react-native": "2.20.0-beta.2", - "@amazon-devices/react-native-localize": "~2.0.0", + "@amazon-devices/react-native-localize": "2.1.9000000000-rn-83", "react-native-uuid": "^2.0.2", "react-native": "*", - "@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@~2.0.0" + "@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@2.1.9000000000-rn-83" }, "overrides": { - "@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@~2.0.0" - }, + "@react-native-async-storage/async-storage": "npm:@amazon-devices/react-native-async-storage__async-storage@2.1.9000000000-rn-83" + }, "devDependencies": { "@segment/analytics-react-native": "2.20.0-beta.2", "@types/jest": "^29.5.8", @@ -64,10 +64,10 @@ "typescript": "^5.2.2", "@babel/core": "^7.23.3", "@babel/runtime": "^7.23.2", - "@react-native/eslint-config": "^0.73.2", + "@react-native/babel-preset": "^0.83.0", + "@react-native/eslint-config": "^0.83.0", "@types/node": "^20.9.1", - "@types/react": "^18.2.37", - "@types/react-native": "0.72.6", + "@types/react": "^18.3.0", "@types/uuid": "^9.0.7", "babel-jest": "^29.7.0", "commitlint": "^18.4.2", @@ -75,11 +75,10 @@ "eslint": "^8.56.0", "husky": "^8.0.3", "jest": "^29.7.0", - "metro-react-native-babel-preset": "^0.77.0", "prettier": "^2.8.8", - "react": "18.2.0", - "react-native": "^0.72.0", - "react-native-builder-bob": "^0.23.1", + "react": "18.3.1", + "react-native": "^0.83.0", + "react-native-builder-bob": "^0.30.0", "react-native-uuid": "^2.0.2" }, "react-native-builder-bob": {