-
Notifications
You must be signed in to change notification settings - Fork 926
Move all metro logic and commands into a metro package #1447
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
Merged
grabbou
merged 19 commits into
react-native-community:master
from
afoxman:cli-bundle-api
Oct 4, 2021
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
02e96a6
Move metro configuration and bundling logic into their own packages, …
afoxman 76f019f
Rename metro-config package to metro
afoxman e55648c
Move cli-bundle-api package and bundle command (cli package) into metro.
afoxman 3fa4c4d
Move resolveNodeModuleDir to cli-tools package
afoxman 4db4e31
Move releaseChecker into cli-tools
afoxman 1f359ef
Move hookStdout to cli-tools
afoxman e1da75c
Move start command into metro package
afoxman 7d46022
Merge remote-tracking branch 'origin/master' into cli-bundle-api
afoxman d47dab3
Merge remote-tracking branch 'origin/master' into cli-bundle-api
afoxman 75e00a2
Rename 'metro' package to 'cli-plugin-metro'.
afoxman 11786fd
Update dependency
afoxman 7fa0133
More renaming
afoxman d6462a3
Revert buildBundle to default export
afoxman 9f88c58
Make exports explicit
afoxman c053379
Revert exports to default
afoxman 83a290f
PR feedback
afoxman 18338dc
Merge branch 'react-native-community:master' into cli-bundle-api
afoxman 5ec6ae8
refactor(structure): moved some files around to reflect the conventio…
grabbou 27f74ab
Fix type bug, export missing funciton/type.
afoxman 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@react-native-community/cli-plugin-metro", | ||
"version": "6.0.0", | ||
"license": "MIT", | ||
"main": "build/index.js", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@react-native-community/cli-tools": "^6.0.0-rc.0", | ||
"@react-native-community/cli-server-api": "^6.0.0-rc.0", | ||
"chalk": "^3.0.0", | ||
"metro": "^0.66.1", | ||
"metro-config": "^0.66.1", | ||
"metro-core": "^0.66.1", | ||
"metro-react-native-babel-transformer": "^0.66.1", | ||
"metro-resolver": "^0.66.1", | ||
"metro-runtime": "^0.66.1", | ||
"mkdirp": "^0.5.1", | ||
"readline": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@react-native-community/cli-types": "^6.0.0" | ||
}, | ||
"files": [ | ||
"build", | ||
"!*.map" | ||
], | ||
"homepage": "https://github.com/react-native-community/cli/tree/master/packages/cli-plugin-metro", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/react-native-community/cli.git", | ||
"directory": "packages/cli-plugin-metro" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,4 @@ | ||
export {default as bundleCommand} from './bundle'; | ||
export {buildBundleWithConfig} from './buildBundle'; | ||
export type {CommandLineArgs} from './bundleCommandLineArgs'; | ||
export {default as ramBundleCommand} from './ramBundle'; |
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
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,6 @@ | ||
import {bundleCommand, ramBundleCommand} from './bundle'; | ||
import startCommand from './start'; | ||
|
||
export default [bundleCommand, ramBundleCommand, startCommand]; | ||
export {buildBundleWithConfig} from './bundle'; | ||
export type {CommandLineArgs} from './bundle'; |
File renamed without changes.
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
3 changes: 1 addition & 2 deletions
3
packages/cli/src/commands/start/watchMode.ts → ...gin-metro/src/commands/start/watchMode.ts
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,12 @@ | ||
export { | ||
Config, | ||
ConfigLoadingContext, | ||
MetroConfig, | ||
getDefaultConfig, | ||
default as loadMetroConfig, | ||
} from './tools/loadMetroConfig'; | ||
export { | ||
default as commands, | ||
buildBundleWithConfig, | ||
CommandLineArgs, | ||
} from './commands'; |
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
File renamed without changes.
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,12 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"outDir": "build" | ||
}, | ||
"references": [ | ||
{"path": "../cli-types"}, | ||
{"path": "../cli-server-api"}, | ||
{"path": "../tools"}, | ||
] | ||
} |
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
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
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 |
---|---|---|
@@ -1,15 +1,2 @@ | ||
import path from 'path'; | ||
|
||
/** | ||
* Finds a path inside `node_modules` | ||
*/ | ||
export default function resolveNodeModuleDir( | ||
root: string, | ||
packageName: string, | ||
): string { | ||
return path.dirname( | ||
require.resolve(path.join(packageName, 'package.json'), { | ||
paths: [root], | ||
}), | ||
); | ||
} | ||
import {resolveNodeModuleDir} from '@react-native-community/cli-tools'; | ||
export default resolveNodeModuleDir; |
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
File renamed without changes.
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
3 changes: 2 additions & 1 deletion
3
.../tools/releaseChecker/getLatestRelease.ts → ...ls/src/releaseChecker/getLatestRelease.ts
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
4 changes: 2 additions & 2 deletions
4
...ges/cli/src/tools/releaseChecker/index.ts → packages/tools/src/releaseChecker/index.ts
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
2 changes: 1 addition & 1 deletion
2
...c/tools/releaseChecker/printNewRelease.ts → ...ols/src/releaseChecker/printNewRelease.ts
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
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,15 @@ | ||
import path from 'path'; | ||
|
||
/** | ||
* Finds a path inside `node_modules` | ||
*/ | ||
export default function resolveNodeModuleDir( | ||
root: string, | ||
packageName: string, | ||
): string { | ||
return path.dirname( | ||
require.resolve(path.join(packageName, 'package.json'), { | ||
paths: [root], | ||
}), | ||
); | ||
} |
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
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.
Uh oh!
There was an error while loading. Please reload this page.