diff --git a/CodePush.js b/CodePush.js index 2d1d9deda..f9815e1b0 100644 --- a/CodePush.js +++ b/CodePush.js @@ -5,6 +5,15 @@ import { AppState, Platform } from "react-native"; import log from "./logging"; import hoistStatics from 'hoist-non-react-statics'; +if (typeof __DEV__ !== "undefined" && __DEV__) { + console.warn( + "[CodePush] @code-push-next/react-native-code-push is deprecated in favor of Codemagic Patch " + + "(@codemagic/react-native-patch), which includes a web dashboard, native fingerprinting and " + + "support for new React Native versions. " + + "https://patch.codemagic.io/docs/migration/migrating-from-codepush" + ); +} + let NativeCodePush = require("react-native").NativeModules.CodePush; const PackageMixins = require("./package-mixins")(NativeCodePush); diff --git a/README.md b/README.md index 28ce784de..706ab9d0f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -> **From the maintainers:** We build [Codemagic Patch](https://github.com/codemagic-ci-cd/codemagic-patch), a self-hosted OTA update service for React Native — server, client SDK, CLI, and dashboard — where our new development happens, and we recommend it for new projects. If you want to migrate from self-hosted CodePush, see the [migration guide](https://github.com/codemagic-ci-cd/codemagic-patch/blob/main/docs/migrate-from-codepush.md). +> **DEPRECATED:** This package is frozen. No new features and no React Native version support will ship here. Last targeted support is in the React Native 0.82 era (`v10.4+`). +> +> Use [Codemagic Patch](https://patch.codemagic.io/docs/migration/migrating-from-codepush) (`@codemagic/react-native-patch`) instead, which includes a web dashboard, native fingerprinting and support for new React Native versions. +> +> Migration guide: https://patch.codemagic.io/docs/migration/migrating-from-codepush # React Native Module for CodePush diff --git a/package.json b/package.json index 232987355..36f9b7eb0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@code-push-next/react-native-code-push", "version": "10.4.3", - "description": "React Native plugin for the CodePush service", + "description": "Deprecated in favor of Codemagic Patch (@codemagic/react-native-patch), which includes a web dashboard, native fingerprinting and support for new React Native versions. https://patch.codemagic.io/docs/migration/migrating-from-codepush", "main": "CodePush.js", "typings": "typings/react-native-code-push.d.ts", "homepage": "https://github.com/codemagic-ci-cd/react-native-code-push", @@ -13,6 +13,7 @@ "author": "Code Push Next", "license": "MIT", "scripts": { + "postinstall": "node scripts/postinstall.js", "clean": "shx rm -rf bin", "setup": "npm install --quiet --no-progress", "prebuild:tests": "npm run clean && npm run tslint", diff --git a/scripts/postinstall.js b/scripts/postinstall.js new file mode 100644 index 000000000..9b3bd3eb5 --- /dev/null +++ b/scripts/postinstall.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +"use strict"; + +const migrateUrl = + "https://patch.codemagic.io/docs/migration/migrating-from-codepush"; + +console.warn( + [ + "", + "[DEPRECATED] @code-push-next/react-native-code-push is deprecated in favor of", + "Codemagic Patch (@codemagic/react-native-patch), which includes a web dashboard,", + "native fingerprinting and support for new React Native versions.", + migrateUrl, + "", + ].join("\n") +);