()
| 58 | }; |
| 59 | |
| 60 | const getBuildInfo = async () => { |
| 61 | const cwd = join(__dirname, '..', '..'); |
| 62 | |
| 63 | const isExperimental = process.env.RELEASE_CHANNEL === 'experimental'; |
| 64 | |
| 65 | const branch = await execRead('git branch | grep \\* | cut -d " " -f2', { |
| 66 | cwd, |
| 67 | }); |
| 68 | const commit = await execRead('git show -s --no-show-signature --format=%h', { |
| 69 | cwd, |
| 70 | }); |
| 71 | const checksum = await getChecksumForCurrentRevision(cwd); |
| 72 | const dateString = await getDateStringForCommit(commit); |
| 73 | const version = isExperimental |
| 74 | ? `0.0.0-experimental-${commit}-${dateString}` |
| 75 | : `0.0.0-${commit}-${dateString}`; |
| 76 | |
| 77 | // React version is stored explicitly, separately for DevTools support. |
| 78 | // See updateVersionsForNext() below for more info. |
| 79 | const packageJSON = await readJson( |
| 80 | join(cwd, 'packages', 'react', 'package.json') |
| 81 | ); |
| 82 | const reactVersion = isExperimental |
| 83 | ? `${packageJSON.version}-experimental-${commit}-${dateString}` |
| 84 | : `${packageJSON.version}-${commit}-${dateString}`; |
| 85 | |
| 86 | return {branch, checksum, commit, reactVersion, version}; |
| 87 | }; |
| 88 | |
| 89 | const getChecksumForCurrentRevision = async cwd => { |
| 90 | const packagesDir = join(cwd, 'packages'); |
no test coverage detected