-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: #Changelog: [Internal] - This is an attempt to fix public publishing of eslint-plugin-specs. Currently, internal consumption of this package assumes access to `react-native-codegen/src` but for external usage, we leverage the published `react-native-codegen` which transforms files out to the `lib` folder vs. `src`. For a similar-ish suit, this change is adding a prepublish step that will very basically update the references. Reviewed By: mdvacca Differential Revision: D32910080 fbshipit-source-id: f5e508090cbbf5097a848ddef3b721002a6c6277
- Loading branch information
1 parent
60e60a9
commit 2d06e6a
Showing
3 changed files
with
72 additions
and
10 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,44 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
const fs = require('fs'); | ||
|
||
/** | ||
* script to prepare package for publish. | ||
* | ||
* Due to differences to how we consume internal packages, update a flag | ||
*/ | ||
|
||
fs.readFile('./react-native-modules.js', 'utf8', function (readError, source) { | ||
if (readError != null) { | ||
return console.error( | ||
'Failed to read react-native-modules.js for publish', | ||
readError, | ||
); | ||
} | ||
|
||
const result = source.replace( | ||
'const PACKAGE_USAGE = false;', | ||
'const PACKAGE_USAGE = true;', | ||
); | ||
|
||
fs.writeFile( | ||
'./react-native-modules.js', | ||
result, | ||
'utf8', | ||
function (writeError) { | ||
if (writeError != null) { | ||
return console.error( | ||
'Failed to update react-native-modules.js for publish', | ||
writeError, | ||
); | ||
} | ||
}, | ||
); | ||
}); |
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