expo-widgets 58.0.18 → 58.0.20

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 58.0.20
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix Android apps crashing at launch with `constructor cannot be null` when they use expo-widgets. The `CustomNotification` class now has a constructor that throws, because instances only come from `CustomNotificationFactory`. ([#51655](https://github.com/expo/expo/pull/51655) by [@voida6](https://github.com/voida6))
8
+ - Fix the Android build failing with `Unresolved reference 'jakex7'`. Custom notifications now import the `io.github.expo.peek` packages that the `peek-emittables` dependency provides. ([#51654](https://github.com/expo/expo/pull/51654) by [@voida6](https://github.com/voida6))
9
+ - [Android] Fix the layout registry script exiting without output when the package path contains a symlink, for example in a pnpm install. ([#51641](https://github.com/expo/expo/pull/51641) by [@juliusmarminge](https://github.com/juliusmarminge))
10
+ - Updated dependencies. ([#51617](https://github.com/expo/expo/pull/51617))
11
+ - @expo/ui@58.0.20
12
+
13
+ ## 58.0.19
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies. ([#51632](https://github.com/expo/expo/pull/51632), [#51636](https://github.com/expo/expo/pull/51636))
18
+ - @expo/ui@58.0.19
19
+
3
20
  ## 58.0.18
4
21
 
5
22
  ### Patch Changes
@@ -6,7 +6,7 @@ plugins {
6
6
  }
7
7
 
8
8
  group = 'expo.modules.widgets'
9
- version = '58.0.18'
9
+ version = '58.0.20'
10
10
 
11
11
  def expoWidgetsPackageDirFile = project.projectDir.parentFile
12
12
  def expoWidgetsPackageDir = expoWidgetsPackageDirFile.absolutePath
@@ -39,7 +39,7 @@ android {
39
39
  namespace "expo.modules.widgets"
40
40
  defaultConfig {
41
41
  versionCode 1
42
- versionName '58.0.18'
42
+ versionName '58.0.20'
43
43
  consumerProguardFiles("proguard-rules.pro")
44
44
 
45
45
  externalNativeBuild {
@@ -6,6 +6,7 @@ import expo.modules.kotlin.functions.Coroutine
6
6
  import expo.modules.kotlin.modules.Module
7
7
  import expo.modules.kotlin.modules.ModuleDefinition
8
8
  import expo.modules.widgets.notifications.CustomNotification
9
+ import expo.modules.widgets.notifications.CustomNotificationCreationException
9
10
  import expo.modules.widgets.notifications.CustomNotificationFactory
10
11
  import expo.modules.widgets.notifications.CustomNotificationOptions
11
12
  import expo.modules.widgets.notifications.CustomNotificationUpdateOptions
@@ -84,6 +85,10 @@ class WidgetsModule : Module() {
84
85
  }
85
86
 
86
87
  Class("CustomNotification", CustomNotification::class) {
88
+ Constructor { ->
89
+ throw CustomNotificationCreationException()
90
+ }
91
+
87
92
  Function("getId") { notification: CustomNotification ->
88
93
  notification.id
89
94
  }
@@ -14,8 +14,8 @@ import android.os.Bundle
14
14
  import androidx.core.app.NotificationCompat
15
15
  import androidx.core.app.NotificationManagerCompat
16
16
  import expo.modules.widgets.R
17
- import io.github.jakex7.peek.notification.PeekNotificationViews
18
- import io.github.jakex7.peek.notification.setPeekContent
17
+ import io.github.expo.peek.notification.PeekNotificationViews
18
+ import io.github.expo.peek.notification.setPeekContent
19
19
 
20
20
  internal object CustomNotificationBuilder {
21
21
  private const val DEFAULT_CHANNEL_ID = "expo_widgets_notifications"
@@ -38,6 +38,12 @@ internal class CustomNotificationNotFoundException(name: String, id: String) :
38
38
  internal class CustomNotificationCancelledException :
39
39
  CodedException("The custom notification operation was cancelled before it could be posted.")
40
40
 
41
+ internal class CustomNotificationCreationException :
42
+ CodedException(
43
+ "A custom notification can't be created directly. " +
44
+ "Use CustomNotificationFactory post(), get() or getActive() instead."
45
+ )
46
+
41
47
  internal class SmallIconNotFoundException(name: String) :
42
48
  CodedException(
43
49
  "The drawable '$name' passed as `smallIcon` was not found in the app's resources. " +
@@ -8,9 +8,9 @@ import expo.modules.widgets.WidgetsStorage
8
8
  import expo.modules.widgets.evaluateLayout
9
9
  import expo.modules.widgets.getWidgetEnvironment
10
10
  import expo.modules.widgets.toPeekRoot
11
- import io.github.jakex7.peek.emittables.peekEmittableNotificationViews
12
- import io.github.jakex7.peek.notification.PeekNotificationSizes
13
- import io.github.jakex7.peek.notification.PeekNotificationViews
11
+ import io.github.expo.peek.emittables.peekEmittableNotificationViews
12
+ import io.github.expo.peek.notification.PeekNotificationSizes
13
+ import io.github.expo.peek.notification.PeekNotificationViews
14
14
 
15
15
  internal object CustomNotificationRenderer {
16
16
  suspend fun render(context: Context, state: CustomNotificationState): PeekNotificationViews {
@@ -3,7 +3,7 @@ package expo.modules.widgets.notifications
3
3
  import android.annotation.SuppressLint
4
4
  import android.content.Context
5
5
  import androidx.core.app.NotificationManagerCompat
6
- import io.github.jakex7.peek.notification.PeekNotificationViews
6
+ import io.github.expo.peek.notification.PeekNotificationViews
7
7
  import kotlinx.coroutines.CancellationException
8
8
  import kotlinx.coroutines.Job
9
9
  import kotlinx.coroutines.coroutineScope
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-widgets",
3
- "version": "58.0.18",
3
+ "version": "58.0.20",
4
4
  "description": "Widgets.",
5
5
  "keywords": [
6
6
  "expo",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@expo/plist": "^0.10.1",
31
- "@expo/ui": "~58.0.18"
31
+ "@expo/ui": "~58.0.20"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@expo/internal-scripts": "58.0.3",
@@ -36,7 +36,7 @@
36
36
  "@types/jest": "^30.0.0",
37
37
  "@types/node": "^22.14.0",
38
38
  "@types/react": "~19.3.0",
39
- "expo": "58.0.11",
39
+ "expo": "58.0.13",
40
40
  "react-native": "0.88.0",
41
41
  "resolve-workspace-root": "^2.0.0"
42
42
  },
@@ -154,6 +154,8 @@ function createLayoutRegistry(expectedWidgets, capturedLayouts) {
154
154
  return registry;
155
155
  }
156
156
 
157
- if (process.argv[1] && path.resolve(process.argv[1]) === __filename) {
157
+ // Node resolves symlinks in `import.meta.url`, so compare against the real path of the invoked
158
+ // script. Package managers like pnpm expose the package through a symlink.
159
+ if (process.argv[1] && fs.realpathSync(process.argv[1]) === __filename) {
158
160
  await main();
159
161
  }