-
Notifications
You must be signed in to change notification settings - Fork 8
feat: split into optional dependencies #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gmegidish
wants to merge
1
commit into
main
Choose a base branch
from
feat-split-into-optional-depds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "@mobilenext/mobilecli-darwin-amd64", | ||
| "version": "0.0.4", | ||
| "author": "Mobile Next", | ||
| "description": "mobilecli binary for macOS x64", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/mobile-next/mobilecli.git" | ||
| }, | ||
| "license": "MIT", | ||
| "os": ["darwin"], | ||
| "cpu": ["x64"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "@mobilenext/mobilecli-darwin-arm64", | ||
| "version": "0.0.4", | ||
| "author": "Mobile Next", | ||
| "description": "mobilecli binary for macOS ARM64", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/mobile-next/mobilecli.git" | ||
| }, | ||
| "license": "MIT", | ||
| "os": ["darwin"], | ||
| "cpu": ["arm64"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "@mobilenext/mobilecli-linux-amd64", | ||
| "version": "0.0.4", | ||
| "author": "Mobile Next", | ||
| "description": "mobilecli binary for Linux x64", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/mobile-next/mobilecli.git" | ||
| }, | ||
| "license": "MIT", | ||
| "os": ["linux"], | ||
| "cpu": ["x64"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "@mobilenext/mobilecli-linux-arm64", | ||
| "version": "0.0.4", | ||
| "author": "Mobile Next", | ||
| "description": "mobilecli binary for Linux ARM64", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/mobile-next/mobilecli.git" | ||
| }, | ||
| "license": "MIT", | ||
| "os": ["linux"], | ||
| "cpu": ["arm64"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "@mobilenext/mobilecli-windows-amd64", | ||
| "version": "0.0.4", | ||
| "author": "Mobile Next", | ||
| "description": "mobilecli binary for Windows x64", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/mobile-next/mobilecli.git" | ||
| }, | ||
| "license": "MIT", | ||
| "os": ["win32"], | ||
| "cpu": ["x64"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 733
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 310
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 109
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 738
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 234
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 1913
🏁 Script executed:
# Check if binary files exist in the platform directories find publish/npm-darwin-amd64/ publish/npm-linux-amd64/ -type fRepository: mobile-next/mobilecli
Length of output: 139
🏁 Script executed:
# Let's check the main npm package.json that depends on these cat publish/npm/package.jsonRepository: mobile-next/mobilecli
Length of output: 698
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 530
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 47
🏁 Script executed:
Repository: mobile-next/mobilecli
Length of output: 234
require.resolve(packageName)will fail for these binary-only packages because they lack amainentry pointThe platform-specific packages (
@mobilenext/mobilecli-darwin-amd64,@mobilenext/mobilecli-linux-amd64, etc.) only define apackage.jsonwith nomainfield and contain no JavaScript files. Node'srequire.resolve()requires a resolvable entry point (likemain,index.js, orexports), so it will throw an error for these packages. This causesbinaryPathto never be set and users will always encounter the "Failed to find" error.Use
require.resolve()with an explicit path topackage.jsoninstead:let binaryPath; try { - const packagePath = require.resolve(packageName); - binaryPath = join(packagePath, "..", binaryName); + const packageJsonPath = require.resolve(`${packageName}/package.json`); + binaryPath = join(packageJsonPath, "..", binaryName); } catch (error) { console.error(`Failed to find ${packageName}. Please reinstall @mobilenext/mobilecli.`); process.exit(1); }This resolves
package.jsondirectly (which is guaranteed to exist) and derives the correct binary directory path from there.📝 Committable suggestion
🤖 Prompt for AI Agents