From 9fee99040d771c401605a3ef384e7fbe82833574 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 5 Oct 2023 06:29:49 -0700 Subject: [PATCH] Remove unneeded write to .version file (#39807) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39807 We used to need this file so that we could read the react native version when [creating Hermes artifacts](https://github.com/facebook/react-native/commit/e4b5d3eec9bae44c46795c4be097b31cb48593ae#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47R1507). Originally, that change was introduced [here](https://github.com/facebook/react-native/commit/e4b5d3eec9bae44c46795c4be097b31cb48593ae#diff-78a8a19706dbd2a4425dd72bdab0502ed7a2cef16365ab7030a5a0588927bf47) Despite the fact that that approach was wrong, as we already have the right version in the package.json which is guaranteed to be present, a lot has changed since then and we don't need that file anymore. ## Changelog: [Internal] - Remove lines that write a .version file while releasing on npm Reviewed By: lunaleaps Differential Revision: D49909718 fbshipit-source-id: bd23d6d73001d0b58bf6b0321ed6d4ceb3523e7a --- scripts/publish-npm.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/publish-npm.js b/scripts/publish-npm.js index 7fb72bc557fb4b..1c78f5bd3b9c86 100755 --- a/scripts/publish-npm.js +++ b/scripts/publish-npm.js @@ -81,10 +81,6 @@ function publishNpm(buildType) { generateAndroidArtifacts(version); - // Write version number to the build folder - const versionFile = path.join('build', '.version'); - fs.writeFileSync(versionFile, version); - if (buildType === 'dry-run') { echo('Skipping `npm publish` because --dry-run is set.'); return exit(0);