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

36 Коммитов

Автор SHA1 Сообщение Дата
Alex Hunt d6bf51cad9 Refactor remaining forEachPackage call sites (#43112)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43112

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53942028

fbshipit-source-id: 335bff3c3a31026bae7140fac1d1a6aae23a0f1e
2024-02-20 09:55:46 -08:00
Alex Hunt 1b504382c1 Fix import in bump-all-updated-packages, add Flow (#43106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43106

Missed import in untyped, untested script during recent file move.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53940160

fbshipit-source-id: ec86c5881a2f34d992538c713f808c8d5634ba16
2024-02-20 04:22:55 -08:00
Luna Wei 8ff05b5a18 Remove release-branch-cutoff from yarn bump-all-updated-packages (#43040)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43040

Changelog: [Internal] Remove release-branch-cutoff option as its been replaced by `yarn set-version --skip-react-native-version`

Reviewed By: huntie

Differential Revision: D53742450

fbshipit-source-id: 726479698ec4f4f61d9a1ddde95e246e033f864c
2024-02-16 15:57:37 -08:00
Alex Hunt 80ec096e7c Create shared consts module for scripts
Summary:
Tidy up, removes risk of breakage when relocating inner modules.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53813025

fbshipit-source-id: 43dc4a57191363546d6858cff311e260d416192f
2024-02-16 03:21:25 -08:00
Alex Hunt a68ae2e2cc Rename and document monorepo publish script (#42989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42989

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607805

fbshipit-source-id: 8bbf82c02b54b20404de834800ae49d3fa43baee
2024-02-14 02:57:36 -08:00
Luna Wei 34abd79475 Use set-version for nightly publishes (#42903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42903

Changelog: [Internal] - Update publish-npm to use `set-version` for nightly builds

Now that `set-version` basically does what `set-rn-version` does, this diff uses this logic for nightlies only (as dry-run/pre-alpha variants are non-functional right now)

This does not change the flow of build-type `'release'` -- that will still use `set-rn-version` via CircleCI ([job](https://fburl.com/code/6xo3ijwg), [script](https://fburl.com/code/bo8np0tb))  We will eventually replace that too but that will be later.

This allows us to delete `get-and-update-packages.js` which was a helper written specifically for updating monorepo packages for nightlies.

The purpose of this is to eventually conform all version updates to use `set-version` in all types of releases (nightlies, stable)

bypass-github-export-checks

Reviewed By: cipolleschi

Differential Revision: D53487874

fbshipit-source-id: 734b528ef5bd095ac68f86701ae105daa30c7d68
2024-02-12 12:07:51 -08:00
Alex Hunt d190ccafd3 Add retry to monorepo publish script (#42964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42964

We've seen npm publishes fail occasionally in CI as part of this script, most recently in S391653. This change adds a single retry, per package, during the execution of this script, in an attempt to reduce the chance of manual interventions after a broken pipeline.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607808

fbshipit-source-id: 526d9c33d51ec57702efba3c199bad313c1bf2d4
2024-02-12 10:43:48 -08:00
Alex Hunt 273a5177e0 Use npm as source of truth for updated packages (make publish script rerunnable) (#42944)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42944

Updates `find-and-publish-all-bumped-packages` to use the npm registry as the source of truth, similar to tools like Lerna (`lerna publish from-package`). **This enables safe reruns of the publish script**, and replaces the previous Git-diff-detection implementation.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D53607807

fbshipit-source-id: 135808b7ce36cf463c9f53a8059500b83f8b6679
2024-02-12 10:43:48 -08:00
Alex Hunt 49c3c3412a Refactor package discovery in publish script (#42938)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42938

Substitutes the `forEachPackage` util with a replacement async `getPackages` function. This will be used further in the next diff.

The new function aims to be more erganomic/versatile than `forEachPackage` by returning a package mapping (see updated test mock). The API aligns roughly with `yarn workspaces list` and [Lerna's `detectProjects`](https://lerna.js.org/docs/api-reference/utilities#detectprojects).

This also aligns with / replaces similar attempts in our existing scripts:
- [`getPackagesToPublish`](2ca7bec0c2/scripts/monorepo/get-and-update-packages.js (L56))
- [`getPublicPackages`](2ca7bec0c2/scripts/releases/set-version/index.js (L19))

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607806

fbshipit-source-id: 00ec34edadab863dc8f2f0c7852f6e835a5dddf5
2024-02-12 04:42:27 -08:00
Alex Hunt 56f483ccad Update exit cases for monorepo publish script (#42937)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42937

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607810

fbshipit-source-id: 18e79f23060ee70e96bd8ac6e9995b0a8ba300b3
2024-02-12 04:42:27 -08:00
Alex Hunt b25be6687e Add Flow, add positive test case for monorepo publish step (#42936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42936

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D53607809

fbshipit-source-id: 990826fda5538af9a13e3f24978295a2f3b0c8c3
2024-02-12 04:42:27 -08:00
Luna Wei ebc2831d5b set unified version (#42776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42776

Changelog: [Internal] set all monorepo packages (including react-native) to one version and update all inter-dependencies (including the template)

Reviewed By: huntie

Differential Revision: D53251917

fbshipit-source-id: 95330ca66dcb7234a3f09752ecc3ed9087ced4bf
2024-01-31 19:32:08 -08:00
Luna Wei fe0306d637 Support specifying dist-tags for monorepo package bumps (#42146)
Summary:
Currently our CI will auto-tag any `npm publish` as `latest` for the monorepo packages. This is because [we do not specify a tag](https://github.com/facebook/react-native/blob/main/scripts/monorepo/find-and-publish-all-bumped-packages.js#L104), so npm will [default to `latest`](https://docs.npmjs.com/cli/v10/commands/npm-dist-tag#description). We encountered a similar issue for `react-native` awhile ago and fixed that with [always specifying a tag](https://github.com/facebook/react-native/blob/main/scripts/npm-utils.js#L84), with the explicit opt-in for `latest`.

yarn and npm will resolve `*` dependencies using `latest`. This will be a problem for any React Native version that uses `*` deps. We have actively tried to remove these `*` versions but older patches may still contain them.

When we do a monorepo package bump, it may be for 0.71 and for a user who is initializing a 0.72 version project (that still has * deps), they will receive monorepo packages of version `0.71.x`, which is not compatible. (React Native monorepo packages do not faithfully follow semver)

This change allows us to specify what tags to use and suggest tags based on what branch you are on and asks for confirmation

```
> branch 0.73-stable
? Select suggested npm tags. (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ "0.73-stable"
 ◉ "latest"
? Confirm these tags for *ALL* packages being bumped: "0.73-stable","latest" (Y/n)

> branch 0.72-stable
? Select suggested npm tags. (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ "0.72-stable"
 ◯ "latest"
? Confirm these tags for *ALL* packages being bumped: "0.72-stable" (Y/n)

> branch main
? Select suggested npm tags. (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ "nightly"
? Confirm these tags for *ALL* packages being bumped: "nightly" (Y/n)
```

## Changelog:

[INTERNAL] [CHANGED] - Support dist-tags in publishing monorepo packages to avoid default "latest" tag.

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

Test Plan: `yarn test scripts/`

Reviewed By: NickGerleman

Differential Revision: D52551769

Pulled By: lunaleaps

fbshipit-source-id: 52f923464387cffdc6ca22c6f0a45425965a3680
2024-01-08 08:38:53 -08:00
Luna Wei 05ec058ac5 Add print-packages as a command (#41959)
Summary:
Working on releases, I'm often looking for the name of our monorepo packages (as sometimes the name doesn't align with the directory) and also getting a list of the versions of everything, as well as if its private/public -- which I've interpreted to mean that we publish it or we don't. I thought this might be convenient to add.

## Changelog:
[Internal] - Add `print-packages` as a command to print our monorepo packages (including react-native)

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

Test Plan:
```
❯ yarn print-packages
yarn run v1.22.19
$ node ./scripts/monorepo/print
┌─────────┬─────────┬─────────────────────────────────────────┬────────────────┐
│ (index) │ Public? │                  Name                   │ Version (main) │
├─────────┼─────────┼─────────────────────────────────────────┼────────────────┤
│    0    │  ''   │     'react-native/assets-registry'     │    '0.74.0'    │
│    1    │  ''   │  'react-native/babel-plugin-codegen'   │    '0.74.0'    │
│    2    │  ''   │  'react-native/community-cli-plugin'   │    '0.74.0'    │
│    3    │  ''   │    'react-native/debugger-frontend'    │    '0.74.0'    │
│    4    │  ''   │     'react-native/dev-middleware'      │    '0.74.0'    │
│    5    │  ''   │      'react-native/eslint-config'      │    '0.74.0'    │
│    6    │  ''   │      'react-native/eslint-plugin'      │    '0.74.0'    │
│    7    │  ''   │   'react-native/eslint-plugin-specs'   │    '0.74.0'    │
│    8    │  ''   │ 'react-native/hermes-inspector-msggen' │    '0.72.0'    │
│    9    │  ''   │      'react-native/metro-config'       │    '0.74.0'    │
│   10    │  ''   │    'react-native/normalize-colors'     │    '0.74.1'    │
│   11    │  ''   │      'react-native/js-polyfills'       │    '0.74.0'    │
│   12    │  ''   │             'react-native'              │   '1000.0.0'   │
│   13    │  ''   │      'react-native/babel-preset'       │    '0.74.0'    │
│   14    │  ''   │ 'react-native/metro-babel-transformer' │    '0.74.0'    │
│   15    │  ''   │          'react-native/bots'           │    '0.0.0'     │
│   16    │  ''   │         'react-native/codegen'         │    '0.74.0'    │
│   17    │  ''   │ 'react-native/codegen-typescript-test' │    '0.0.1'     │
│   18    │  ''   │      'react-native/gradle-plugin'      │    '0.74.0'    │
│   19    │  ''   │         'react-native/tester'          │    '0.0.1'     │
│   20    │  ''   │       'react-native/tester-e2e'        │    '0.0.1'     │
│   21    │  ''   │    'react-native/typescript-config'    │    '0.74.0'    │
│   22    │  ''   │    'react-native/virtualized-lists'    │    '0.74.0'    │
└─────────┴─────────┴─────────────────────────────────────────┴────────────────┘
  Done in 0.55s.
```

Also added filter flag for private/public
```
❯ yarn print-packages --type private
yarn run v1.22.19
$ node ./scripts/monorepo/print --type private
┌─────────┬─────────┬─────────────────────────────────────────┬────────────────┐
│ (index) │ Public? │                  Name                   │ Version (main) │
├─────────┼─────────┼─────────────────────────────────────────┼────────────────┤
│    0    │  ''   │ 'react-native/hermes-inspector-msggen' │    '0.72.0'    │
│    1    │  ''   │          'react-native/bots'           │    '0.0.0'     │
│    2    │  ''   │ 'react-native/codegen-typescript-test' │    '0.0.1'     │
│    3    │  ''   │         'react-native/tester'          │    '0.0.1'     │
│    4    │  ''   │       'react-native/tester-e2e'        │    '0.0.1'     │
└─────────┴─────────┴─────────────────────────────────────────┴────────────────┘
  Done in 0.16s.
```

Also added a npm query where you can see the latest published version of a minor
```
❯ yarn print-packages --type public --minor 72
yarn run v1.22.19
$ node ./scripts/monorepo/print --type public --minor 72
┌─────────┬─────────┬─────────────────────────────────────────┬────────────────┬──────────────────────────────────────┐
│ (index) │ Public? │                  Name                   │ Version (main) │             Version (72)             │
├─────────┼─────────┼─────────────────────────────────────────┼────────────────┼──────────────────────────────────────┤
│    0    │  ''   │     'react-native/assets-registry'     │    '0.74.0'    │               '0.72.0'               │
│    1    │  ''   │  'react-native/babel-plugin-codegen'   │    '0.74.0'    │               '0.72.3'               │
│    2    │  ''   │  'react-native/community-cli-plugin'   │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│    3    │  ''   │    'react-native/debugger-frontend'    │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│    4    │  ''   │     'react-native/dev-middleware'      │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│    5    │  ''   │      'react-native/eslint-config'      │    '0.74.0'    │               '0.72.2'               │
│    6    │  ''   │      'react-native/eslint-plugin'      │    '0.74.0'    │               '0.72.0'               │
│    7    │  ''   │   'react-native/eslint-plugin-specs'   │    '0.74.0'    │               '0.72.4'               │
│    8    │  ''   │      'react-native/metro-config'       │    '0.74.0'    │              '0.72.11'               │
│    9    │  ''   │    'react-native/normalize-colors'     │    '0.74.1'    │               '0.72.0'               │
│   10    │  ''   │      'react-native/js-polyfills'       │    '0.74.0'    │               '0.72.1'               │
│   11    │  ''   │             'react-native'              │   '1000.0.0'   │               '0.72.8'               │
│   12    │  ''   │      'react-native/babel-preset'       │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│   13    │  ''   │ 'react-native/metro-babel-transformer' │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│   14    │  ''   │         'react-native/codegen'         │    '0.74.0'    │               '0.72.8'               │
│   15    │  ''   │      'react-native/gradle-plugin'      │    '0.74.0'    │              '0.72.11'               │
│   16    │  ''   │    'react-native/typescript-config'    │    '0.74.0'    │ 'No match found for version ^0.72.0' │
│   17    │  ''   │    'react-native/virtualized-lists'    │    '0.74.0'    │               '0.72.8'               │
└─────────┴─────────┴─────────────────────────────────────────┴────────────────┴──────────────────────────────────────┘
```

Reviewed By: cortinico

Differential Revision: D52347140

Pulled By: lunaleaps

fbshipit-source-id: 75811730e1afd5aae2d9fba4e437cd0d3d424a90
2024-01-02 11:46:03 -08:00
Moti Zilberman 0614479042 Silence console logs in individual tests to prevent spam (#41363)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41363

TSIA

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51070939

fbshipit-source-id: 0d764b1e8a7594b7ee795a00349595d72e071cbf
2023-11-07 11:16:02 -08:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Riccardo Cipolleschi 89c9ca0f68 Generalize get-and-update-nightlies (#40786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40786

## Changelog:
[Internal] -  Generalize get-and-update-nightlies

Reviewed By: cortinico

Differential Revision: D49956685

fbshipit-source-id: 506b812b93353526a941f3deb136f6bdc74cce35
2023-10-11 10:09:57 -07:00
Riccardo Cipolleschi 52104c6ee3 Update nightlies to bump all the packages in the monorepo and transitive dependencies (#39600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39600

This change will publish all the packages in the monorepo that are not private as during the nightlies, taking also care of keeping the transitive dependencies aligned.

## Changelog:
[Internal] - Bump packages and transitive dependencies when doing nightlies.

Reviewed By: huntie

Differential Revision: D49502330

fbshipit-source-id: 85e2bde13ed2b5dfe33072c9f99f5aaa2c5063ca
2023-09-22 05:02:43 -07:00
Gijs Weterings e6899326e1 add missing import to find-and-publish-all-bumpted-packages.js after D46131120
Summary: After D46131120 circleci's find_and_publish_bumped_packages job is failing (https://app.circleci.com/pipelines/github/facebook/react-native/30521/workflows/5f896217-b3e2-4ac7-b1ef-ad2e3c30e31f/jobs/984287?invite=true#step-107-304_80). Looks like a missing import

Reviewed By: robhogan

Differential Revision: D48604214

fbshipit-source-id: 352f354a0743f121e4c4fe9fc606c3877e698f07
2023-08-23 08:27:53 -07:00
Lorenzo Sciandra c956a1bd6c chore(releases): improve bump oss script to allow less human errors (#38666)
Summary:
One of the limitations of the existing flow for the release crew is that they need to manually remember to publish all the other packages in the monorepo ahead of a new patch release - this PR modifies the logic for the bump-oss-version script (and makes it available via yarn) so that it will not run if:
* there are git changes lying around
* if some of the packages need a new release

it required a bit of refactoring to extract some portions of the logic from the bump-all-package-versions script, but I think the end result is pretty decent.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [CHANGED] - improve bump oss script to allow less human errors

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

Test Plan:
* checkout this branch
* comment L54 of bump-oss-version.js (to remove the check on the branch name)
* run `yarn bump-all-updated-packages`, verify that it works and that it detects that some packages have unreleased code
* run `yarn bump-oss-version -t asd -v asd` (the "fake" parameters are needed to pass the yargs check), verify that it will throw an error because it finds a package that has unreleased code

Reviewed By: mdvacca

Differential Revision: D48156963

Pulled By: cortinico

fbshipit-source-id: 2473ad5a84578c5236c905fd9aa9a88113fe8d22
2023-08-09 00:46:14 -07:00
Luna Wei 7bcff07f13 Refactor nightly monorepo publish script (#37707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37707

Changelog: [Internal] - Refactor nightly monorepo publish script to also return a map of packages and their current nightly version and rename to reflect. This may refer to a nightly version that was just published (if we detect changes) or the nightly tag on npm if no changes.

In subsequent diffs, will update the react-native nightly script to use this map to set the versions for nightly react-native versions.

Reviewed By: hoxyq

Differential Revision: D46450703

fbshipit-source-id: c4e425924aa6cfdcf10e932e1b151ba05d9b7237
2023-06-09 09:20:08 -07:00
Luna Wei cf27e246ce Fix rm (#37706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37706

Changelog: [Internal] Fix wrong usage of shelljs `rm`

Reviewed By: NickGerleman

Differential Revision: D46450762

fbshipit-source-id: 9e519222642421b596827675af38f643fa84c9f7
2023-06-05 23:25:18 -07:00
Luna Wei fd9e295bef Publish nightly monorepo packages (#37556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37556

Changelog: [Internal]

Before making this change, we need to publish `nightly` versions of all existing monorepo dependencies.

Reviewed By: hoxyq

Differential Revision: D46117197

fbshipit-source-id: bcf6364e068579e63ca19e8161dcd32de4353e56
2023-06-02 17:40:52 -07:00
Luna Wei 7819fef988 Refactor to npm-utils (#37555)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37555

Changelog: [Internal] Refactor some npm commands and centralize in npm-utils.

For now, centralize `getPackageVersionStrByTag` and `publishPackage` and update:
1. `publish-npm` to use utilities. This is how we publish `react-native` for commitlies, releases, and nightlies
2. Update `find-and-publish-all-bumped-packages.js` where we publish our monorepo dependencies

Reviewed By: cortinico, hoxyq

Differential Revision: D46131120

fbshipit-source-id: e6020058eb94b4f8d95068b8cd87cc765711be5b
2023-05-24 14:42:54 -07:00
Ruslan Lesiutin 04df252aa7 RN [refactor]: bump and realign package versions by running a single script (#36568)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36568

Changelog: [Internal]

Okay, so before the monorepo migration we had to use two scripts separately:
1. Bumping every package with `npm run bump-all-updated-packages`
2. Aligning other packages versions with `npm run align-package-versions`

The reason for it is that *before the monorepo* in a release branch cutoff process we had a step, which was removing `workspaces` keyword from `react-native` package. Without this keyword all new versions of packages will be resolved from npm (where they will be not available yet, because we have to publish them prior to it)

This is not the case for our current setup, and we can actually bump packages versions and they will be resolved as a workspaces successfully

Reviewed By: cortinico, cipolleschi

Differential Revision: D44261057

fbshipit-source-id: 31c2157be2d3b33bc073651d6045efcef2e8f5c5
2023-03-27 07:31:45 -07:00
Ruslan Lesiutin 9b6aaa731d RN [fix]: update template location in align-package-versions.js script
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D44218613

fbshipit-source-id: 505962b500821252679084a44e7d92e52c6fbf49
2023-03-20 15:41:42 -07:00
Ruslan Lesiutin c35675bbe0 fix[align-package-version]: fixed updating application dependencies for react-native package (#36534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36534

Changelog: [Internal]

- Added option to include react-native package in forEachPackage func
- Used this in align-package-versions.js

Reviewed By: cortinico

Differential Revision: D44152939

fbshipit-source-id: da173e78945d8185ae7e35e29d08926de1700fa4
2023-03-20 07:05:52 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Ruslan Lesiutin 8d8b44a5e3 Add option to commit with generic message (#36421)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36421

Changelog: [Internal]

Adding an extra choice for commit question, user can now choose between three options:
1. Commit with generic message, no further actions needed
2. Commit with custom message, intercative VIM input will open
3. Not committing anything

Reviewed By: cortinico

Differential Revision: D43943526

fbshipit-source-id: 014215105d192961486b7d1c697f491697492812
2023-03-09 09:19:17 -08:00
Ruslan Lesiutin b72dc7f2c4 fix: update publishing packages tag message prefix (#36348)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36348

Changelog: [Internal]

Turns out that Phabricator strips `@` symbol from `@...` tags when exports commits to GitHub. Proposing to use `#` instead.

#publish-packages-to-npm

Reviewed By: cortinico

Differential Revision: D43712415

fbshipit-source-id: 86fc728eb0cb63afb6a9fe592a9ae998da2ce2e4
2023-03-02 03:55:51 -08:00
Ruslan Lesiutin 18b402cbd0 refactor(bump-all-updated-packages): use tag instead of custom commit message (#36220)
Summary:
Having custom commit message script is not an option for `main` branch, because we have internal tooling, which strips `[x]` tags from commit messages before merging them into `main` branch.

Instead of constant commit message, we are now using a tag which will be concatenated with the commit message, which was entered via interactive commit dialog, see demo below.

## Changelog
[Internal] - updated validation in bumping packages script

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

Test Plan: https://user-images.githubusercontent.com/28902667/220163767-015bf37b-6914-4df2-84d9-aa25fb2887d3.mov

Reviewed By: cortinico

Differential Revision: D43443597

Pulled By: hoxyq

fbshipit-source-id: 08e5e08524a1d934fbb35529e025358d7bf3b203
2023-02-21 01:39:51 -08:00
Ruslan Lesiutin 9856c334bd fix(publishing-bumped-packages): look for status code instaead of stderr (#36004)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36004

Changelog: [Internal]

This fixes CircleCI job, which is responsible for publishing bumped packages. We should not check for `stderr`, apparently `npm` uses it to store debug information:
- https://github.com/npm/npm/issues/118#issuecomment-325440

So we've tried to use this on 0.71-stable before and it succesfully published one package, but have exited right after it because `stderr` was not empty

Reviewed By: cortinico, cipolleschi

Differential Revision: D42836212

fbshipit-source-id: 6f2a9a512121683268fe6aae6a187fccb8d9dfbc
2023-01-30 06:22:12 -08:00
Ruslan Lesiutin 91397d4247 refactor(bump-all-updated-packages): support force-bump to next minor version of the package (#35810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35810

Changelog: [Internal]

`bump-all-updated-packages` script now supports `release-branch-cutoff` argument

If this argument is provided, the script will bump each public package to next minor version

Updated [wiki](https://github.com/facebook/react-native/wiki/Release-and-its-automated-processes) with relevant information about how to use it

Reviewed By: cortinico

Differential Revision: D42455329

fbshipit-source-id: a40d2f5dc356f22d3182da3a118c6383b634817d
2023-01-12 03:35:41 -08:00
Ruslan Lesiutin 4d8ba7b9fd refactor(scripts/monorepo/tests): moved related tests to scripts/monorepo/__tests__
Summary:
Changelog: [Internal]
just a small cleanup, moved all tests related to monorepo scripts under `/scripts/monorepo`

Reviewed By: cortinico

Differential Revision: D42308455

fbshipit-source-id: 7743a2af1381ff748556c15b89cf980f8f907674
2023-01-10 13:23:06 -08:00
Ruslan Lesiutin ec28c5bbaa feat(react-native-github): a script to automate patch version bumping of packages (#35767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35767

Changelog: [Internal]

Introducing a script, which can be used to identify all packages inside `/packages`, which contain any changes after the last time its version was changed

How it works step by step:

```
check that no git changes are present

for each package:
    if package is private -> skip

    grep id of the last commit that changed package
    grep id of the last commit that changed version of the package

    if these ids are different:
        bump package patch version

commit changes if required
```

Can be executed only in git environment and by running: `node ./scripts/bump-all-updated-packages`

 ---

Also adding a separate script `align-package-versions.js`, which can be used to update versions of packages inside consumer packages

```
check that no git changes are present

for each package x:
   for each package y:
       if y has x as dependency:
           validate that y uses the latest version of x

if some changes were made:
   run yarn
```

 ---

Q: Why `run_yarn` step was removed from CircleCI flow?
A: For *-stable branches, there are no yarn workspaces and all packages are specified as direct dependencies, so if we update `react-native/assets-registry` to the next version, we won't be able to run `yarn` for react-native root package, because updated version is not yet published to npm

To avoid this, we first need publish new versions and then update them in consumer packages

 ---
The final flow:
1. Developer uses `node ./scripts/bump-all-updated-packages` to bump versions of all updated packages.
2. Commit created from step 1 being merged or directly pushed to `main` or `*-stable` branches
3. A workflow from CircleCI publishes all updated versions to npm
4. Developer can use `align-package-versions.js` script to create required changes to align all packages versions

Reviewed By: cortinico

Differential Revision: D42295344

fbshipit-source-id: 54b667adb3ee5f28d19ee9c7991570451549aac2
2023-01-10 13:23:06 -08:00
Ruslan Lesiutin 83afdafae4 feat(react-native-github): automate publishing bumped packages via circleci (#35621)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35621

Changelog: [Internal]

1. Added `for-each-package.js` script. This can be used to iterate through all of the packages inside `/packages` with the access to package manifest. This soon can be used as a replacement for `yarn workspaces --info`
2. Added `find-and-publish-all-bumped-packages.js` script. This script iterates through all the packages and detects if the version was changed via `git log -p` (same as `git diff`). If so, it tries to publish it to npm.
3. Added corresponding job and workflow to CircleCI config, which will use this script

Reviewed By: cortinico

Differential Revision: D41972733

fbshipit-source-id: c5d0ed5b852b744a699ecb88861ea3e82200e1f3
2022-12-14 02:17:16 -08:00