@marktiderman/genesis-cli 1.11.1 → 1.11.2

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.
@@ -8,7 +8,7 @@
8
8
  * Add your types here, then send them from your server with `notify()` from
9
9
  * `@marktiderman/genesis-notifications/server` (never from the app).
10
10
  */
11
- import { GENESIS_TEST_CATEGORY, GENESIS_TEST_TYPE, MESSAGE_ACTIONS, defineNotifications } from "@marktiderman/genesis-notifications";
11
+ import { GENESIS_TEST_CATEGORY, GENESIS_TEST_TYPE, defineNotifications } from "@marktiderman/genesis-notifications";
12
12
  import { copy } from "@/copy";
13
13
 
14
14
  export const notifications = defineNotifications({
@@ -16,7 +16,7 @@ export const notifications = defineNotifications({
16
16
  activity: { label: copy.push.activityTitle, description: copy.push.activityDescription },
17
17
  ...GENESIS_TEST_CATEGORY,
18
18
  },
19
- actions: { message: MESSAGE_ACTIONS },
19
+ // No message actions here: chat registers its own `messages` category (Reply, Mark as read) in push.ts.
20
20
  types: {
21
21
  // An example: something in the app needs the person. Rename or replace it.
22
22
  "starter.activity": {
@@ -45,6 +45,8 @@ export function createStarterPush() {
45
45
  platform: Platform.OS,
46
46
  projectId: (Constants.expoConfig?.extra?.eas?.projectId as string | undefined) ?? Constants.easConfig?.projectId ?? null,
47
47
  appVersion: Application.nativeApplicationVersion,
48
+ // Devices and preferences on the notifier's tables. An app that registers devices its own way
49
+ // spreads in only the preferences: `{ register, forget, ...notificationsPushPreferences(supabase) }`.
48
50
  backend: notificationsPushBackend(supabase),
49
51
  ...pushOptions,
50
52
  onResponse: onChatPushResponse,
package/dist/vite.js CHANGED
@@ -1127,7 +1127,7 @@ function unusedComponents(ctx) {
1127
1127
  // ../../scripts/lib/native-primitives.mjs
1128
1128
  var NATIVE_WRAPPED_PRIMITIVES = Object.freeze({
1129
1129
  Modal: Object.freeze(["NativeDialog", "NativeSheet", "NativeDrawer"]),
1130
- ActivityIndicator: Object.freeze(["NativeSkeleton", "NativeProgress"])
1130
+ ActivityIndicator: Object.freeze(["NativeLoadingState", "NativeSkeleton", "NativeProgress"])
1131
1131
  });
1132
1132
  function wrappedPrimitivesIn(namedImports) {
1133
1133
  return namedImports.split(",").map((n) => n.trim()).filter((n) => n && !/^type\s/.test(n)).map((n) => n.split(/\s+as\s+/)[0].trim()).filter((n) => n && Object.hasOwn(NATIVE_WRAPPED_PRIMITIVES, n));
@@ -1395,6 +1395,13 @@ function checkCustomHeaders(ctx, pkg) {
1395
1395
  });
1396
1396
  }
1397
1397
  }
1398
+ var LOADING_ROUTE_COMPANIONS = /* @__PURE__ */ new Set(["NativeLoadingState", "Stack.Screen", "Fragment", "React.Fragment"]);
1399
+ function isLoadingOnlyRoute(code) {
1400
+ const loading = [...code.matchAll(/<NativeLoadingState\b([^>]*)>/g)];
1401
+ if (loading.length === 0 || loading.some((m) => /\bfullScreen\s*=\s*\{\s*false\s*\}/.test(m[1] ?? ""))) return false;
1402
+ const tags = [...code.matchAll(/<([A-Z][\w.]*)/g)].map((m) => m[1] ?? "");
1403
+ return tags.every((t) => LOADING_ROUTE_COMPANIONS.has(t));
1404
+ }
1398
1405
  function routerRoot(ctx) {
1399
1406
  if (ctx.config.native?.routerRoot) return ctx.config.native.routerRoot.replace(/\/+$/, "");
1400
1407
  return existsSync(path14.join(ctx.root, "src", "app")) ? "src/app" : "app";
@@ -1417,12 +1424,13 @@ function checkScreenLayouts(ctx, pkg) {
1417
1424
  });
1418
1425
  return;
1419
1426
  }
1420
- const renders2 = new RegExp(`<(?:${layouts.join("|")}|Redirect)\\b`);
1427
+ const renders2 = new RegExp(`<(?:${[...layouts, "Redirect"].join("|")})\\b`);
1428
+ const loadingOnly = pkg.values.has("NativeLoadingState") ? isLoadingOnlyRoute : () => false;
1421
1429
  const byPath = new Map(ctx.files.map((f) => [f.absolutePath, f]));
1422
1430
  for (const file of routes) {
1423
1431
  if (!JSX_EXTS3.has(file.ext) || NON_SCREEN_ROUTE.test(file.path)) continue;
1424
1432
  if (!/\bexport\s+default\b/.test(file.code) || !/<[A-Za-z]/.test(file.code)) continue;
1425
- if (renders2.test(file.code)) continue;
1433
+ if (renders2.test(file.code) || loadingOnly(file.code)) continue;
1426
1434
  const viaImport = localImports(ctx.root, file).some((abs) => {
1427
1435
  const target = byPath.get(abs) ?? readSource(abs);
1428
1436
  return target !== null && renders2.test(target.code);