Skip to content

feat: ignoredRouteFiles#593

Merged
zetavg merged 3 commits intomainfrom
ignoredRouteFiles
Aug 2, 2025
Merged

feat: ignoredRouteFiles#593
zetavg merged 3 commits intomainfrom
ignoredRouteFiles

Conversation

@zetavg
Copy link
Collaborator

@zetavg zetavg commented Jul 30, 2025

Implements an ignoredRouteFiles option that allows developers to exclude specific files from being treated as routes during the route discovery process.

import { defineConfig } from 'vite'
import { one } from 'one/vite'

export default defineConfig({
  plugins: [
    one({
      router: {
        ignoredRouteFiles: ['**/*.test.*'],
      },
    }),
  ],
})

Currently, this feature supports glob patterns starting with **/* due to Metro bundler limitations (as we need to convert it to RegExp for require.context used by Metro).

  • Adds ignoredRouteFiles configuration option to exclude files from route generation
  • Implements support for both Vite and Metro bundlers with appropriate glob pattern handling
  • Includes comprehensive test coverage for web and iOS platforms

References

@railway-app
Copy link

railway-app bot commented Jul 30, 2025

This PR was not deployed automatically as @zetavg does not have access to the Railway project.

In order to get automatic PR deploys, please add @zetavg to your team on Railway.

@zetavg zetavg requested a review from Copilot July 30, 2025 20:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements an ignoredRouteFiles feature that allows developers to exclude specific files from being treated as routes during the route discovery process. The feature supports glob patterns starting with **/* and is configured through the router.ignoredRouteFiles option in the Vite configuration.

  • Adds ignoredRouteFiles configuration option to exclude files from route generation
  • Implements support for both Vite and Metro bundlers with appropriate glob pattern handling
  • Includes comprehensive test coverage for web and iOS platforms

Reviewed Changes

Copilot reviewed 15 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/one/src/vite/types.ts Adds TypeScript type definition for ignoredRouteFiles configuration option
packages/one/src/vite/plugins/virtualEntryPlugin.ts Updates virtual entry generation to handle ignored route files in glob patterns
packages/one/src/metro-config/getViteMetroPluginOptions.ts Implements Metro bundler support for ignored route files using regex patterns
packages/one/src/babel-plugins/one-router-metro.ts Adds Babel plugin support for Metro's require context regex
packages/one/metro-entry-ctx.js Updates Metro entry context to use dynamic regex for file filtering
tests/test/vite.config.ts Configures test setup with ignored route files pattern
tests/test/tests/router/ignoredRouteFiles/*.ts Adds comprehensive test coverage for both web and iOS platforms
tests/test/app/router/ignoredRouteFiles/*.tsx Creates test route files to validate ignore functionality
packages/test/src/utils/appium.ts Improves error handling in test utilities
Comments suppressed due to low confidence (1)

@zetavg zetavg added this pull request to the merge queue Aug 2, 2025
Merged via the queue into main with commit 3ef1aa1 Aug 2, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant