Skip to content

fix: use GitHub URLs for plugin includes instead of relative paths#10

Merged
abueide merged 3 commits intomainfrom
fix/use-github-urls-for-plugin-includes
Apr 15, 2026
Merged

fix: use GitHub URLs for plugin includes instead of relative paths#10
abueide merged 3 commits intomainfrom
fix/use-github-urls-for-plugin-includes

Conversation

@abueide
Copy link
Copy Markdown
Contributor

@abueide abueide commented Apr 15, 2026

Summary

Update react-native plugin to use GitHub URLs for including android and ios plugins instead of relative file paths.

Changes

  • Change path:../android/plugin.json to github:segment-integrations/mobile-devtools?dir=plugins/android
  • Change path:../ios/plugin.json to github:segment-integrations/mobile-devtools?dir=plugins/ios
  • Example app continues to use local path for testing local plugin changes

Why

Relative paths break when plugins are included via GitHub URL (e.g., github:segment-integrations/mobile-devtools?dir=plugins/react-native). The path resolver can't resolve ../android relative to a GitHub URL directory parameter.

This fix allows consumers to cleanly include just the react-native plugin via GitHub URL, and it will automatically pull in android and ios dependencies using GitHub URLs as well.

Final State

  • Plugin: Uses GitHub URLs internally (will fetch android/ios from GitHub)
  • Example: Uses local path path:../../plugins/react-native/plugin.json for testing
  • External consumers: Will use github:segment-integrations/mobile-devtools?dir=plugins/react-native

Testing Strategy

Tests will fail on this PR because the plugin tries to fetch android/ios from GitHub (main branch) before this change is merged. Force merge this PR, then tests will pass on subsequent runs since main will have the proper GitHub URL structure.

Usage

External repos can now use:

{
  "include": [
    "github:segment-integrations/mobile-devtools?dir=plugins/react-native"
  ]
}

🤖 Generated with Claude Code

- Change react-native plugin to include android/ios via GitHub URLs
- Fixes issue where relative paths break when using GitHub URL includes
- Enables proper usage via github:segment-integrations/mobile-devtools?dir=plugins/react-native

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
abueide added a commit to segmentio/analytics-react-native that referenced this pull request Apr 15, 2026
- Remove explicit android/ios plugin includes
- Use mobile-devtools branch with GitHub URL includes fix
- React-native plugin now properly includes android/ios via GitHub URLs
- Depends on segment-integrations/mobile-devtools#10

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@abueide abueide marked this pull request as ready for review April 15, 2026 19:05
abueide and others added 2 commits April 15, 2026 14:24
- Change from local path to GitHub URL with PR branch ref
- Fixes test failures where local plugin has GitHub URL includes
- Tests the production scenario of including via GitHub URL
- After merge, will update to use main branch

This fixes the react-native E2E test failures where mixing local
path includes with GitHub URL includes caused conflicts.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change back to path:../../plugins/react-native/plugin.json
- Example should test local plugin during development
- Plugin internally uses GitHub URLs for android/ios dependencies
- External consumers use GitHub URLs to include the plugin

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@abueide abueide merged commit f5cf13a into main Apr 15, 2026
9 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