forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-release version fix (facebook#12148)
* Ran updated release script to fix deps * Release script handles prerelease deps correctly * Update noop-renderer dependencies on reconciler package
- Loading branch information
Showing
9 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,6 @@ | |
"object-assign": "^4.1.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.0.0" | ||
"react": "^16.0.0 || 16.3.0-alpha.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
scripts/release/build-commands/update-noop-renderer-dependencies.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
const {readJson, writeJson} = require('fs-extra'); | ||
const {join} = require('path'); | ||
const semver = require('semver'); | ||
const {execUnlessDry, logPromise} = require('../utils'); | ||
|
||
const getReactReconcilerVersion = async cwd => { | ||
const path = join(cwd, 'packages', 'react-reconciler', 'package.json'); | ||
const json = await readJson(path); | ||
return json.version; | ||
}; | ||
|
||
const update = async ({cwd, dry}) => { | ||
const path = join(cwd, 'packages', 'react-noop-renderer', 'package.json'); | ||
const json = await readJson(path); | ||
|
||
// IMPORTANT: This script must be run after update-package-versions, | ||
// Since it depends up the updated react-reconciler version. | ||
const reconcilerVersion = await getReactReconcilerVersion(cwd); | ||
|
||
// There is no wildcard for semver that includes prerelease ranges as well. | ||
// This causes problems for our Yarn workspaces setup, | ||
// Since the noop-renderer depends on react-reconciler. | ||
// So we have a special case check for this that ensures semver compatibility. | ||
if (semver.prerelease(reconcilerVersion)) { | ||
json.dependencies['react-reconciler'] = `* || ${reconcilerVersion}`; | ||
} else { | ||
json.dependencies['react-reconciler'] = '*'; | ||
} | ||
|
||
await writeJson(path, json, {spaces: 2}); | ||
|
||
await execUnlessDry( | ||
`git commit -am "Updating dependencies for react-noop-renderer"`, | ||
{cwd, dry} | ||
); | ||
}; | ||
|
||
module.exports = async params => { | ||
return logPromise(update(params), 'Updating noop renderer dependencies'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters