Граф коммитов

35 Коммитов

Автор SHA1 Сообщение Дата
Luna Wei 6958bbb28c Fix up lint errors under react-native-github (#33622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33622

Changelog: [Internal] Clean up eslint errors

Reviewed By: yungsters

Differential Revision: D35599445

fbshipit-source-id: bbb9061a3cf9df32daacad9a9b44eba94d3ce48c
2022-04-22 16:25:25 -07:00
Luna Wei 76a2cf3569 Use CircleCI API to trigger releases (#32937)
Summary:
Changelog: [Internal]
* Refactor release automation so it doesn't use intermediate tags to trigger the release workflow. Now, we POST to CircleCI's ["trigger pipeline" API](https://circleci.com/docs/api/v2/#operation/triggerPipeline)
* This does have the con of needing to give CircleCI project permission for whoever wants to run a release as you'll need a token to trigger
* See related discussion: https://github.com/reactwg/react-native-releases/discussions/7#discussioncomment-1836420

Description of changes:
* Changes to config.yml allow us to use our POST data to trigger a certain workflow. There is no direct API to trigger a workflow, CircleCI only has an API to trigger pipelines, so the suggestion is to leverage conditionals: https://support.circleci.com/hc/en-us/articles/360050351292-How-to-trigger-a-workflow-via-CircleCI-API-v2
* Update `bump-oss-version` to make the api call -- the instructions for running a release are still the same: https://github.com/facebook/react-native/wiki/Release-Process#creating-0minor0-rc0
   * Would be good to make this a yarn script as tido64 mentioned
* Remove unused utilities now that we don't use intermediate tags like `publish-...`

Pull Request resolved: https://github.com/facebook/react-native/pull/32937

Test Plan:
Have this on a Github branch and tried this out locally:

## Running release script
Running the bump-oss script (I had to hack it locally to be allowed to run on a non-release branch):
{F694804729}
* Link to resulting workflow: https://app.circleci.com/pipelines/github/facebook/react-native/11836 -- you can [verify that the parameters are the same as I passed](https://app.circleci.com/pipelines/github/facebook/react-native/11836/workflows/59ac0c86-5fe3-4d7a-80e9-c61129d49e9f/jobs/232388?invite=true#step-106-2)

## Other attempts triggering this workflow
Notice that when I tried to run it on an actual release-branch (0.67-stable) but because the `config.yml` changes aren't on that branch, the job faisl
| {F694804321} |

## Verifying the right workflows trigger on a regular push
* Notice that the workflows "analysis" and "test" are still triggered on push (ie, the `unless:` clause isn't messing things up)
{F694804320}

Reviewed By: sota000

Differential Revision: D33715336

Pulled By: lunaleaps

fbshipit-source-id: 82672d6d50768015bdfc9f4ea4d22aa801b84f06
2022-01-24 14:08:43 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Luna Wei 3bd11599c9 Update bump-oss-version.js to guide releaser through release actions (#32769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32769

Changelog: [Internal] Re-purpose bump-oss-version to guide releaser to correctly tag the release and trigger relevant CircleCI jobs

Reviewed By: sota000

Differential Revision: D33121691

fbshipit-source-id: 739f920cd9a04dfb436aff1abe9a05a51df4c32c
2021-12-17 18:37:38 -08:00
Luna Wei c034b7e7e1 Bump dependency on eslint-plugin-specs to minimum 0.0.2
Summary: Changelog: [Internal] - Update our release package.json to reference the react-native/eslint-plugin-specs module and a version > 0.0.2

Reviewed By: sota000

Differential Revision: D32973565

fbshipit-source-id: 49bfdb94f5dfdd9617e5849010241e4dda9dc9db
2021-12-09 15:57:20 -08:00
Luna Wei 68e6788daf Fix npm latest tag issue when releasing patches (#32543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32543

Changelog: [Internal] Fix npm `latest` tag issue that occurs when we release a patch on an older minor version

Context:
* There are two types of tags, git and npm, they are unrelated.

* When we publish a stable release, we set the git tag `latest`. This logic is faulty when we release a patch to an older version.

* When publishing a package to npm, if you don't provide an explicit tag, the `latest` tag will be applied -- at least that's how I've understood the [docs here](https://docs.npmjs.com/cli/v7/commands/npm-dist-tag#description). This again is faulty logic when we release a patch to an older version.

* npm and git's `latest` tag should always point to our most recent stable version

This change:
* Introduces a `--latest` flag for `bump-oss-script` that will indicate that the release we're running (either a stable or pre-release) should really be considered "latest"
* If the version is not a pre-release and the `--latest` flag is set, we will set the git `latest` tag
* Later, in the circleCI job that we use to publish the npm package, we will see if the current commit is git-tagged as `latest`. If it is, then we'll explicitly tell npm to use `latest` tag but most importantly, if it's not, we'll set a tag of the form `{major}.{minor}-stable`.
* This type of tag (ex. `0.66-stable`) is new and the intention is that it will always point to latest of that minor version.

Reviewed By: hramos

Differential Revision: D32196239

fbshipit-source-id: 4c881851eebcad8585732ff0c07322413ac46ce5
2021-11-05 15:09:11 -07:00
Luna Wei cc1e3abb6e Extract version parsing from release script
Summary: Changelog: [Internal] - extract logic for parsing version in bump-oss-version and add tests

Reviewed By: cortinico

Differential Revision: D32196238

fbshipit-source-id: 6ea7af3d282eea1d876118f056bca94a151e6182
2021-11-05 15:09:11 -07:00
Tim Yung 77ecc7ede1 JS: Format with Prettier v2.4.1 [3/n]
Summary:
Changelog:
[General][Internal]

Reviewed By: zertosh

Differential Revision: D31883447

fbshipit-source-id: cbbf85e4bf935096d242336f41bf0cc5d6f92359
2021-11-02 22:14:16 -07:00
Gustavo Sverzut Barbieri 57aa70c06c Introduce Gemfile, ruby-version (#32303)
Summary:
Implement par of the discussion https://github.com/react-native-community/discussions-and-proposals/discussions/411, except the `.nvmrc` part, this includes:
 - Setting `.ruby-version` in the main project and also `template/`
 - Fixing the CocoaPods version with a project-level `Gemfile` and also `template/Gemfile`
 - Using all `pod` executions from `bundle exec pod`, using the determined version
 - Script to manage and update the ruby version

## Changelog

[iOS] [Added] - Gemfile with CocoaPods 1.11 and ruby-version (2.7.4)

Pull Request resolved: https://github.com/facebook/react-native/pull/32303

Test Plan: Build for iOS and run all CircleCI tests to see if nothing changed

Reviewed By: RSNara

Differential Revision: D31344686

Pulled By: fkgozali

fbshipit-source-id: 25c63131ca9b16d3cf6341019548e0d63bdcaefe
2021-10-01 21:22:26 -07:00
Héctor Ramos b29b05fa98 bump-oss-version: Add -v / --to-version argument and use it when bumping nightly releases (now at 20:00 UTC)
Summary:
Add a new -v or --to-version argument to the bump-oss-version script.

When the bump-oss-version script runs, it will use the version string that is passed in, instead of trying to infer it from the current commit. This fixes a bug in the last nightly release where the bump script used a different version string than what the publish script expected.

Nightlies now run at 20:00 hours UTC.

Changelog: [Internal]

Reviewed By: fkgozali, TheSavior

Differential Revision: D31261829

fbshipit-source-id: a9341f93c3c7bf0379aa3c5e7f345182df70f846
2021-09-29 00:11:32 -07:00
Héctor Ramos 667cfb2302 Make react-native-codegen a dependency for releases
Summary:
We only need to ensure `react-native-codegen` is a direct dependency of `react-native` in open source releases. Otherwise, we can use the package from source at `packages/react-native-codegen`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D31190817

fbshipit-source-id: 527b1c370a35c3efad2448b510172a87c7345ee2
2021-09-25 08:14:03 -07:00
Kevin Gozali ec9e97179e OSS: bump-oss-version -- update Podfile.lock later in the flow
Summary:
There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow.

This also restrict the version number change check to the specific files for better reliability

Changelog: [Internal]

Reviewed By: sota000

Differential Revision: D31160139

fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd
2021-09-23 19:31:36 -07:00
Kevin Gozali d3c7e20183 OSS: update Podfile.lock automatically when bumping release version
Summary:
To ensure consistency of RNTester Podfile.lock:
* introduce a script to run `pod install` on the current commit
* have the script check the exact CocoaPods version to use for consistency
* have version bump script run this automatically to keep it up-to-date with the version change

To validate, have this change in `0.66-stable` branch, then try:

```
./scripts/bump-oss-version.js 0.66.0-rc.5
```

This automatically ran `pod install` which produced the Podfile.lock update.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D31132867

fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90
2021-09-23 08:27:27 -07:00
Luna Wei 963254e2ec Copy repo-config dependencies for bumping release version
Summary:
Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead

Original commit changeset: 1dd2adc6a036

Reviewed By: fkgozali

Differential Revision: D30599065

fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e
2021-09-01 02:26:32 -07:00
Luna Wei 5d6484e0a8 Keep repo-config workspace in bump-oss-version
Summary: Changelog: [Internal][Fixed] - Keep repo-config as a workspace for bumping oss release version. Fixes CI jobs not having tooling dependencies

Reviewed By: yungsters

Differential Revision: D30595543

fbshipit-source-id: 1dd2adc6a0363202efb5314b7e8eb44618b50327
2021-08-26 18:56:07 -07:00
Christoph Nakazawa f3930a93d5 Split React Native repo into product/infra packages
Summary: Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D23165627

fbshipit-source-id: f371c070f8b297c218d2989ff3b553a8b83c18ea
2020-08-18 12:10:09 -07:00
Héctor Ramos 07def55396 fbshipit-source-id: da15f69185e724eaf7d4bc78dbc61fcdcb3074d5 2020-03-13 21:46:45 -07:00
Nick Gerleman 427ba359e0 Stamp React Native Version Into C++ Code (#28036)
Summary:
The PlatformConstants native module exposes the ability to query the React
Native version used to build native code. This is managed on iOS and Android by
a version bumping script, which replaces module code based on a template.

It is currently difficult to accurately determine this version for out-of-tree C++
platforms (I.e. React Native Windows). The version of upstream react-native we resolve to is ultimately
dependent on the version of react-native chosen a peer dependency, which is not
neccesarily constant given a build of react-native-windows.

We could try to hack around this, and make our native build try to reason about
the resolved pacakge for react-native using a lockfile, but a much cleaner
solution is to embed version into C++ code, similar to what is done for Android
and iOS. This change does that, adding a header with React Native version and
updating the build stamping script to write to it.

Usage sample:

```c++
  constants["reactNativeVersion"] = folly::dynamic::object();
  constants["reactNativeVersion"]["major"] = ReactNativeVersion.Major;
  constants["reactNativeVersion"]["minor"] = ReactNativeVersion.Minor;
  constants["reactNativeVersion"]["patch"] = ReactNativeVersion.Patch;
```
## Changelog

[General] [Added] - Stamp React Native Version Into C++ Code
Pull Request resolved: https://github.com/facebook/react-native/pull/28036

Test Plan: Validated that the bumping script will accurately update the header, can compile under both MSVC and Clang.

Differential Revision: D19865992

Pulled By: hramos

fbshipit-source-id: 9e0b8e9519015bb62c60b9935a234cd367a1926a
2020-02-27 06:42:14 -08:00
Andres Suarez 3b31e69e28 Tidy up license headers [2/n]
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: yungsters

Differential Revision: D17952694

fbshipit-source-id: 17c87de7ebb271fa2ac8d00af72a4d1addef8bd0
2019-10-16 10:06:34 -07:00
Kacper Wiszczuk 421ffb05ae Adjust test manual e2e script to work with new init (#24583)
Summary:
Since initialisation flow changed with default template, we need to adjust the script to make it work properly.

[General] [Fixed] - Adjust text manual e2e script to work with new init.
Pull Request resolved: https://github.com/facebook/react-native/pull/24583

Differential Revision: D15062374

Pulled By: cpojer

fbshipit-source-id: 8110597b27056570784439362f12963154460613
2019-04-25 02:03:10 -07:00
Kacper Wiszczuk 6df2edeb2a Bump react-native version in template in release script (#24262)
Summary:
Since template has a fixed version in `template/package.json`, we want to automate this process.

[General] [Added] - Bump react-native in `template/package.json`
Pull Request resolved: https://github.com/facebook/react-native/pull/24262

Differential Revision: D14724831

Pulled By: cpojer

fbshipit-source-id: 164d13001a889941398f3db3b9b96eb9d5114cc3
2019-04-02 08:14:56 -07:00
Nimish 9f4ee25cf7 fix: remove the unused packages and convert minimist to yargs (#23467)
Summary:
`Minimist` package functionality can be done easily using `yargs` package. Also removed couple of unused dependencies.

[General] [changed] - used `yarns` package instead of `minimist` package

Pull Request resolved: https://github.com/facebook/react-native/pull/23467

Differential Revision: D14099638

Pulled By: cpojer

fbshipit-source-id: 59de2086e4204e09c91fd2c99d209ca32c0ef82c
2019-02-15 05:54:10 -08:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Eli White 0e5c2633ee Prettier files with shebang
Reviewed By: yungsters

Differential Revision: D7974564

fbshipit-source-id: 00db563ce24868c0fde117e981936b83cec30e48
2018-05-11 13:52:30 -07:00
Leo Natan 30469ed001 Expose React Native version as a symbol rather than macro
Summary:
Add RCTGetReactNativeVersion() to expose version in native code. Right now, version is exposed internally to RN using a MACRO constant. This exposes a symbol (function) that can be called to retrieve the React Native version in iOS.

Also exposed RCTVersion.h as a public header in the React project so it is available to developers.

The motivation behind this is for https://github.com/wix/detox —we need to know what RN version the user has, if any, so we can properly handle support and abstract differences.

Ran bump-oss-version.js to ensure the template is applied properly. Also compiled the project to make sure nothing is broken.

 [IOS] [ENHANCEMENT] [RCTVersion.h] - Expose version as a compile-time symbol for native queries

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18136

Differential Revision: D7141076

Pulled By: hramos

fbshipit-source-id: 18a92b8c60d7b43fa0ed22597ea46a35cff73c56
2018-03-02 14:51:39 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
Mike Grabowski b2eb7fd77b Fix broken releases script
Summary:
Fails on my machine due to fact that `replace` returns an instance of a String, rather than an instance of ShellString (that includes `to` on its prototype).

Solution is to use an explicit `writeFileSync`. You can see that change in the wild on 0.50-stable branch.

CC janicduplessis (edit by hramos)
Closes https://github.com/facebook/react-native/pull/16303

Differential Revision: D6031331

Pulled By: hramos

fbshipit-source-id: 41c583d53df75bea1a55fa19174d912e414209c0
2017-10-11 19:47:03 -07:00
Janic Duplessis 0cd69e8a02 Run eslint --fix
Summary:
CI is currently failing because of a lint issue, this fixes it and a bunch of other warnings that are auto-fixable.

**Test plan**
Quick manual test, cosmetic changes only.
Closes https://github.com/facebook/react-native/pull/16229

Differential Revision: D6009748

Pulled By: TheSavior

fbshipit-source-id: cabd44fed99dd90bd0b35626492719c139c89f34
2017-10-09 17:46:44 -07:00
Janic Duplessis 1af645b2fd Validate that JS and Native code versions match for RN releases
Summary:
Basic implementation of the proposal in #15271

Note that this should not affect facebook internally since they are not using OSS releases.

Points to consider:
- How strict should the version match be, right now I just match exact versions.
- Wasn't able to use haste for ReactNativeVersion because I was getting duplicate module provider caused by the template file in scripts/versiontemplates. I tried adding the scripts folder to modulePathIgnorePatterns in package.json but that didn't help.
- Redscreen vs. warning, I think warning is useless because if the app crashes you won't have time to see the warning.
- Should the check and native modules be __DEV__ only?

**Test plan**
Tested that it works when version match and that it redscreens when versions don't before getting other errors on Android and iOS.
Closes https://github.com/facebook/react-native/pull/15518

Differential Revision: D5813551

Pulled By: hramos

fbshipit-source-id: 901757e25724b0f22bf39de172b56309d0dd5a95
2017-09-27 18:31:15 -07:00
Eli White 320aea8bca shelljs/global -> shelljs
Reviewed By: zertosh

Differential Revision: D5407207

fbshipit-source-id: df5d1a38a35d27c9c429ea972acab58322441813
2017-07-12 16:08:22 -07:00
Eloy Durán 19caaba1d5 Fixes current CI failures and allows tree shaking of native dev support code.
Summary:
* The dev support code moved into a `DevSupport` subspec, meaning that only if the subspec is specified in the user’s Podfile will the packager client, dev menu, etc be included. This is mainly done through checks for header availability.

  It also improves the weird situation where you had to specify the `RCTWebSocket` subspec if you wanted to be able to use the packager client during development.

* I removed hardcoding the release version in the podspec on release, because the podspec still relies on `package.json` when evaluating, so there’s no real point in not also getting the version number from there. This should remove any requirement to perform maintenance of the OSS release script regarding the podspec.
Closes https://github.com/facebook/react-native/pull/12602

Differential Revision: D4621021

Pulled By: ericvicenti

fbshipit-source-id: 6c208371fc40ea607809a6ab05dd3714ed9980cf
2017-02-27 14:04:58 -08:00
Mike Grabowski 096acbd53d Match on `s.version` only
Summary:
Recent PR by alloy adds `s.cocoapods_version`. That makes `release script` also modify that value. Adding `\` makes `sed` match on a dot character (I believe missing `\` was a mistake).

Used and tested here: https://github.com/facebook/react-native/commits/0.42-stable

CC bestander
Closes https://github.com/facebook/react-native/pull/12381

Differential Revision: D4558370

Pulled By: bestander

fbshipit-source-id: 3bee7bac3002c0c83c100ce9d0c67463e030a428
2017-02-16 20:44:59 -08:00
James Ide eb4be7af38 Support the --remote option in bump-oss-version.js script
Summary:
In my RN checkout, I use "upstream" as my remote instead of "origin" -> this lets me run `scripts/bump-oss-version.js --remote upstream 0.41.1` for example.

Also made the script executable so we don't need to put `node` in front of it, and updated the Releases.md doc.
Closes https://github.com/facebook/react-native/pull/12230

Differential Revision: D4515070

Pulled By: mkonicek

fbshipit-source-id: f218a6b77959588ee5f625b8589ac080dd010034
2017-02-06 07:13:42 -08:00
Mike Grabowski db06fc6814 Better release script
Summary: Automatically tags and publish them upstream, less steps required in order to do the release rather than just `bump-oss-version.js`

Differential Revision: D3913826

Pulled By: bestander

fbshipit-source-id: 6e023e7ab7b486ff6e6cc8e946f19e10a7ceeef8
2016-09-23 08:28:35 -07:00
Konstantin Raev aec90bb46b Version release script
Summary:npm-publish.js is not cohesive enough: besides building and publishing it also modifies some files.

It is better to have a separate script that will bump versions, make a commit and tag it.

scripts/bump-oss-version.js does exactly that.

This simplifies release process and allows manual release to npm if CI is not available.
Closes https://github.com/facebook/react-native/pull/6625

Differential Revision: D3092849

fb-gh-sync-id: 92cf38bd3df31c8c9c433fc5f9e15c129855fe0e
shipit-source-id: 92cf38bd3df31c8c9c433fc5f9e15c129855fe0e
2016-03-24 08:41:24 -07:00