-
Notifications
You must be signed in to change notification settings - Fork 24k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update shared build to strip Babel wrapper (#44339)
Summary: Pull Request resolved: #44339 We require the wrapper code for in repository calls to these packages directly from node (i.e. using CommonJS). This wrapper code typically sits at the entrypoint of the build packages (i.e. `index.js`). NOTE: This unblocks an issue preventing me from landing further work on the `helloworld` cli replacing the community template. ## Problem: The [flow-api-translator](https://www.npmjs.com/package/flow-api-translator) library doesn't allow CommonJS `module.exports` when generating TypeScript Type Defintions. ## Change 1. At the built time, this strips out our wrapper code and sets up the dist/ folder appropriately for npm distribution. 2. Updated the `package.json` files to consistently share Flow types Changelog: [Internal] refactor build packages output to remove wrapper. NOTE: Added better error messages when users deviated from the current pattern: {F1501571608} Reviewed By: huntie Differential Revision: D56762162 fbshipit-source-id: f110b31e4ad780998dbc81a2482891ac8d8c6458
- Loading branch information
1 parent
d280772
commit b38f80a
Showing
7 changed files
with
195 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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 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,20 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow strict-local | ||
* @format | ||
* @oncall react_native | ||
*/ | ||
|
||
/*:: | ||
export type * from './index.flow'; | ||
*/ | ||
|
||
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) { | ||
require('../../../scripts/build/babel-register').registerForMonorepo(); | ||
} | ||
|
||
module.exports = require('./index.flow'); |
This file was deleted.
Oops, something went wrong.
This file contains 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,53 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow strict-local | ||
* @format | ||
* @oncall react_native | ||
*/ | ||
|
||
// Usage: | ||
// | ||
// > const semver = require('semver'); | ||
// > semver.satisfies(process.env.ANDROID_SDK, android.ANDROID_SDK); | ||
// true | ||
// | ||
// The version of @react-native/core-cli-utils matches a particular version | ||
// of react-native. For example: | ||
// | ||
// > npm info @react-native/core-cli-util@latest --json | jq '.version' | ||
// > "0.75.0" | ||
// | ||
// Means that: | ||
// > require('@react-native/core-cli-utils/versions.js').apple.XCODE | ||
// > ">= 12.x" | ||
// | ||
// For react-native@0.75.0 you have to have a version of XCode >= 12 | ||
|
||
export const android = { | ||
ANDROID_NDK: '>= 23.x', | ||
ANDROID_SDK: '>= 33.x', | ||
}; | ||
|
||
export const apple = { | ||
COCOAPODS: '>= 1.10.0', | ||
XCODE: '>= 12.x', | ||
}; | ||
|
||
export const common = { | ||
BUN: '>= 1.0.0', | ||
JAVA: '>= 17 <= 20', | ||
NODE_JS: '>= 18', | ||
NPM: '>= 4.x', | ||
RUBY: '>= 2.6.10', | ||
YARN: '>= 1.10.x', | ||
}; | ||
|
||
export const all = { | ||
...apple, | ||
...android, | ||
...common, | ||
}; |
This file contains 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 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 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