@acms-subir/core 0.3.8 → 0.3.9

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,11 @@
1
1
  # @acms-subir/core
2
2
 
3
+ ## 0.3.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix the mobile events recipe's "Add to calendar" on Expo SDK 57: load the compose sheet from `expo-calendar/legacy` (the root export now throws), import it lazily so a missing native module falls back to sharing, and note that it needs a development build.
8
+
3
9
  ## 0.3.8
4
10
 
5
11
  ### Patch Changes
@@ -1,9 +1,11 @@
1
1
  import { Platform, Share } from 'react-native';
2
- import * as Calendar from 'expo-calendar';
3
2
  import type { Event } from '@acms-subir/client';
4
3
 
5
4
  // Opens the system "add event" sheet (no calendar permission needed). Where
6
- // that is unavailable (web, older devices) it falls back to sharing the event.
5
+ // that is unavailable (web, Expo Go, no native module) it falls back to sharing
6
+ // the event. The module is loaded lazily so a missing native module reaches the
7
+ // fallback instead of crashing the screen. SDK 57+ keeps the compose sheet in
8
+ // `expo-calendar/legacy`; the root export throws for it.
7
9
  export async function addToCalendar(event: Event, occurrence: { start: string; end: string; allDay: boolean }) {
8
10
  const details = {
9
11
  title: event.title,
@@ -17,6 +19,7 @@ export async function addToCalendar(event: Event, occurrence: { start: string; e
17
19
  };
18
20
  if (Platform.OS !== 'web') {
19
21
  try {
22
+ const Calendar = await import('expo-calendar/legacy');
20
23
  await Calendar.createEventInCalendarAsync(details);
21
24
  return;
22
25
  } catch {
@@ -10,6 +10,7 @@
10
10
  "/events/[slug]"
11
11
  ],
12
12
  "next": [
13
- "Link to it from a screen: <Link href=\"/events\">Events</Link> (expo-router)"
13
+ "Link to it from a screen: <Link href=\"/events\">Events</Link> (expo-router)",
14
+ "Add to calendar needs a development build (npx expo run:ios / run:android); in Expo Go it falls back to sharing"
14
15
  ]
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acms-subir/core",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },