Skip to content

Commit feffe63

Browse files
committed
Migrate to Typescript and separate files for better ESM support
1 parent 61b6a62 commit feffe63

39 files changed

Lines changed: 7325 additions & 2859 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,5 @@ Examples/testapp_rn
198198

199199
# generated by bob
200200
lib/
201+
202+
src/internals/version.ts

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ In order to ensure that your end users always have a functioning version of your
4949

5050
If you are migrating from `react-native-code-push`, see below ["Migrating to AppZung CodePush"](#migrating-to-appzung-codepush).
5151

52+
Otherwise:
53+
5254
```shell
5355
npm install --save @appzung/react-native-code-push
5456
```
@@ -102,8 +104,9 @@ If you are less in a hurry, you can migrate to `@appzung/react-native-code-push`
102104
#### Change your JS code
103105

104106
1. Replace every `react-native-code-push` imports with `@appzung/react-native-code-push` imports
105-
2. (optional) If you use a jest global mock, move the mock from `__mocks__/react-native-code-push.ts` to `__mocks__/@appzung/react-native-code-push.ts`
106-
3. (optional) If you use dynamic deployment assignation, rename `deploymentKey` option to `releaseChannelPublicId` (TypeScript should catch that)
107+
2. (optional) As the package is now compatible with ESM, if you call CodePush functions like `CodePush.sync()` or import types/interfaces, you may have to replace your imports `import CodePush from` to selective imports `import withCodePush, { sync, DownloadProgress } from` (or `import * as CodePush from`)
108+
3. (optional) If you use a jest global mock, move the mock from `__mocks__/react-native-code-push.ts` to `__mocks__/@appzung/react-native-code-push.ts`
109+
4. (optional) If you use dynamic deployment assignation, rename `deploymentKey` option to `releaseChannelPublicId` (TypeScript should catch that)
107110

108111
#### Change your iOS setup
109112

0 commit comments

Comments
 (0)