-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: init uses yarn assuming version > 1.x #2329
fix: init uses yarn assuming version > 1.x #2329
Conversation
4f84ea8
to
6dd1ff8
Compare
__e2e__/init.test.ts
Outdated
|
||
const yarnConfigFiles: string[] = []; | ||
if (yarnVersion.major >= 3) { | ||
yarnConfigFiles.push('.yarnrc.yml', '.yarn'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szymonrybczak these were added in #2134, which seem to cause issues with the test for me locally and on CI. If I toggle on the version this now seems fine, but I've no way to validate that locally it works for Yarn 3.
6c8ceaf
to
2e72bec
Compare
args: string[] | undefined, | ||
) { | ||
if (!options.expectedFailure && result.code !== 0) { | ||
if (!options.expectedFailure && result.exitCode !== 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was spamming the logs with false positives on the CI E2E tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that some time ago we hit the issue where commands were failing and execa
where reporting status codes as undefined
, hopefully this change will catch all situations when there's a failure.
More details: #2152
@@ -11,7 +11,7 @@ import path from 'path'; | |||
import {unixifyPaths} from '@react-native-community/cli-tools'; | |||
|
|||
export default function findManifest(folder: string) { | |||
let manifestPaths = glob.sync(path.join('**', 'AndroidManifest.xml'), { | |||
let manifestPaths = glob.sync('**/AndroidManifest.xml', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-glob
only wants paths expressed as forward slashes, so we want the opposite behaviour. This was causing failures on the Windows E2E tests.
7e09287
to
e00e5b0
Compare
- Checks that we're using yarn > 1.x when calling `yarn set` which isn't supported [1] but is for later versions [2]. - Update tests to support environment change differences between yarn 1.x & 3.x. - Fix glob.sync to only use forward slashes. [1] https://classic.yarnpkg.com/en/docs/cli/set [2] https://yarnpkg.com/cli/set/version [3] https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
e00e5b0
to
6f95dc4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Summary:
Checks that we're using yarn > 1.x when calling
yarn set
which isn't supported [1] but is for later versions [2]. This also updated the E2E test to vary depending on whether yarn 1 or 3 is running.[1] https://classic.yarnpkg.com/en/docs/cli/set
[2] https://yarnpkg.com/cli/set/version
Test Plan:
Ran against earlier version of yarn where I hit this.
Checklist