runcloud 0.2.172 → 0.2.173

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.
@@ -303,12 +303,10 @@ function evaluateDuplicateRoutes(root, item) {
303
303
  return makeItem(item, 'pass', 'No Expo Router app directory found.', 'scan: app/ directory absent');
304
304
  const routes = new Map();
305
305
  for (const file of walkFiles(appDir)) {
306
- if (!/\.(tsx|ts|jsx|js)$/.test(file) || /(^|\/)_layout\.(tsx|ts|jsx|js)$/.test(toRel(root, file)))
306
+ if (!/\.(tsx|ts|jsx|js)$/.test(file))
307
307
  continue;
308
- const route = routePath(appDir, file);
309
- const current = routes.get(route) ?? [];
310
- current.push(toRel(root, file));
311
- routes.set(route, current);
308
+ for (const route of routeKeys(appDir, file))
309
+ routes.set(route, [...(routes.get(route) ?? []), toRel(root, file)]);
312
310
  }
313
311
  const duplicates = [...routes.entries()].filter(([, files]) => files.length > 1);
314
312
  if (!duplicates.length)
@@ -571,12 +569,15 @@ function routerDir(root) {
571
569
  const src = path.join(root, 'src', 'app');
572
570
  return safeStat(src)?.isDirectory() ? src : path.join(root, 'app');
573
571
  }
574
- function routePath(appDir, file) {
575
- const rel = toRel(appDir, file).replace(/\.(tsx|ts|jsx|js)$/, '');
576
- const parts = rel.split('/').filter((part) => part && !/^\(.+\)$/.test(part));
577
- if (parts[parts.length - 1] === 'index')
578
- parts.pop();
579
- return `/${parts.join('/')}`;
572
+ function routeKeys(appDir, file) {
573
+ let keys = [''];
574
+ for (const part of toRel(appDir, file).replace(/\.(tsx|ts|jsx|js)$/, '').split('/')) {
575
+ let options = /^\(.+,.+\)$/.test(part) ? part.slice(1, -1).split(',').map((group) => `(${group})`) : [part];
576
+ if (keys.length * options.length > 64)
577
+ options = [part];
578
+ keys = keys.flatMap((key) => options.map((option) => `${key}/${option}`));
579
+ }
580
+ return keys;
580
581
  }
581
582
  function evidence(matches) {
582
583
  return matches.slice(0, 5).map((match) => `${match.file}:${match.line}: ${match.text}`).join('\n');
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.172';
1
+ export const CLI_VERSION = '0.2.173';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.172",
3
+ "version": "0.2.173",
4
4
  "description": "Create and control run.cloud remote mobile simulators and cloud sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
Binary file
Binary file