@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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packages": {
3
3
  "@marktiderman/genesis-chat": {
4
- "version": "0.2.2",
4
+ "version": "0.3.0",
5
5
  "blocks": {
6
6
  "chat": {
7
7
  "feature": {
@@ -89,13 +89,13 @@
89
89
  "version": "0.6.3"
90
90
  },
91
91
  "@marktiderman/genesis": {
92
- "version": "0.9.9"
92
+ "version": "0.9.10"
93
93
  },
94
94
  "@marktiderman/genesis-cli": {
95
- "version": "1.11.1"
95
+ "version": "1.11.2"
96
96
  },
97
97
  "@marktiderman/genesis-native": {
98
- "version": "0.4.1",
98
+ "version": "0.4.2",
99
99
  "blocks": {
100
100
  "push": {
101
101
  "feature": {
@@ -273,7 +273,7 @@
273
273
  }
274
274
  },
275
275
  "@marktiderman/genesis-notifications": {
276
- "version": "0.1.2",
276
+ "version": "0.2.0",
277
277
  "blocks": {
278
278
  "notifications": {
279
279
  "feature": {
@@ -701,10 +701,10 @@
701
701
  }
702
702
  },
703
703
  "@marktiderman/genesis-ui": {
704
- "version": "2.16.0"
704
+ "version": "2.17.0"
705
705
  },
706
706
  "@marktiderman/genesis-ui-native": {
707
- "version": "2.4.1"
707
+ "version": "2.5.0"
708
708
  }
709
709
  }
710
710
  }
package/dist/index.js CHANGED
@@ -2082,7 +2082,7 @@ function unusedComponents(ctx) {
2082
2082
  // ../../scripts/lib/native-primitives.mjs
2083
2083
  var NATIVE_WRAPPED_PRIMITIVES = Object.freeze({
2084
2084
  Modal: Object.freeze(["NativeDialog", "NativeSheet", "NativeDrawer"]),
2085
- ActivityIndicator: Object.freeze(["NativeSkeleton", "NativeProgress"])
2085
+ ActivityIndicator: Object.freeze(["NativeLoadingState", "NativeSkeleton", "NativeProgress"])
2086
2086
  });
2087
2087
  function wrappedPrimitivesIn(namedImports) {
2088
2088
  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));
@@ -2350,6 +2350,13 @@ function checkCustomHeaders(ctx, pkg) {
2350
2350
  });
2351
2351
  }
2352
2352
  }
2353
+ var LOADING_ROUTE_COMPANIONS = /* @__PURE__ */ new Set(["NativeLoadingState", "Stack.Screen", "Fragment", "React.Fragment"]);
2354
+ function isLoadingOnlyRoute(code) {
2355
+ const loading = [...code.matchAll(/<NativeLoadingState\b([^>]*)>/g)];
2356
+ if (loading.length === 0 || loading.some((m) => /\bfullScreen\s*=\s*\{\s*false\s*\}/.test(m[1] ?? ""))) return false;
2357
+ const tags = [...code.matchAll(/<([A-Z][\w.]*)/g)].map((m) => m[1] ?? "");
2358
+ return tags.every((t) => LOADING_ROUTE_COMPANIONS.has(t));
2359
+ }
2353
2360
  function routerRoot(ctx) {
2354
2361
  if (ctx.config.native?.routerRoot) return ctx.config.native.routerRoot.replace(/\/+$/, "");
2355
2362
  return existsSync(path14.join(ctx.root, "src", "app")) ? "src/app" : "app";
@@ -2372,12 +2379,13 @@ function checkScreenLayouts(ctx, pkg) {
2372
2379
  });
2373
2380
  return;
2374
2381
  }
2375
- const renders2 = new RegExp(`<(?:${layouts.join("|")}|Redirect)\\b`);
2382
+ const renders2 = new RegExp(`<(?:${[...layouts, "Redirect"].join("|")})\\b`);
2383
+ const loadingOnly = pkg.values.has("NativeLoadingState") ? isLoadingOnlyRoute : () => false;
2376
2384
  const byPath = new Map(ctx.files.map((f) => [f.absolutePath, f]));
2377
2385
  for (const file of routes) {
2378
2386
  if (!JSX_EXTS3.has(file.ext) || NON_SCREEN_ROUTE.test(file.path)) continue;
2379
2387
  if (!/\bexport\s+default\b/.test(file.code) || !/<[A-Za-z]/.test(file.code)) continue;
2380
- if (renders2.test(file.code)) continue;
2388
+ if (renders2.test(file.code) || loadingOnly(file.code)) continue;
2381
2389
  const viaImport = localImports(ctx.root, file).some((abs) => {
2382
2390
  const target = byPath.get(abs) ?? readSource(abs);
2383
2391
  return target !== null && renders2.test(target.code);