Skip to content
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

[0.62] Provide information to metro to redirect to rn-macos when building macos #596

Merged
merged 5 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ado/android-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pr:
include:
- master
- 0.59-stable
- 0.62-stable
Copy link
Member

@alloy alloy Sep 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can’t these (going forward in master) be *-stable?

paths:
exclude:
- '*.md'
Expand Down
1 change: 1 addition & 0 deletions .ado/apple-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pr:
include:
- master
- 0.59-stable
- 0.62-stable
paths:
exclude:
- '*.md'
Expand Down
2 changes: 1 addition & 1 deletion .ado/templates/react-native-macos-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ steps:
- task: CmdLine@2
displayName: Bump package version
inputs:
script: node scripts/bump-oss-version.js --nightly
script: node scripts/bump-oss-version.js --ci 0.62.1000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we now have to update this every time we create a new stable branch or could this be inferred by the script from the current branch name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To bump the stable version of the react-native-macos package we use a different script. Would it be possible to use that here too and not introduce forked changes to the bump-oss-version.js script?


- script: |
npm publish --registry http://localhost:4873
Expand Down
36 changes: 36 additions & 0 deletions react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,42 @@ module.exports = {
projectConfig: android.projectConfig,
dependencyConfig: android.dependencyConfig,
},
macos: {
linkConfig: () => {
return {
isInstalled: (
_projectConfig /*ProjectConfig*/,
_package /*string*/,
_dependencyConfig /*DependencyConfig*/,
) => false /*boolean*/,
register: (
_package /*string*/,
_dependencyConfig /*DependencyConfig*/,
_obj /*Object*/,
_projectConfig /*ProjectConfig*/,
) => {},
unregister: (
_package /*string*/,
_dependencyConfig /*DependencyConfig*/,
_projectConfig /*ProjectConfig*/,
_dependencyConfigs /*Array<DependencyConfig>*/,
) => {},
copyAssets: (
_assets /*string[]*/,
_projectConfig /*ProjectConfig*/,
) => {},
unlinkAssets: (
_assets /*string[]*/,
_projectConfig /*ProjectConfig*/,
) => {},
};
},
projectConfig: () => null,
dependencyConfig: () => null,
npmPackageName: isReactNativeMacOS
? 'react-native-macos'
: 'react-native',
},
},
/**
* Used when running RNTester (with React Native from source)
Expand Down
7 changes: 6 additions & 1 deletion scripts/bump-oss-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ let argv = yargs.option('r', {
alias: 'remote',
default: 'origin',
})
.option('ci', {
type: 'boolean',
default: false,
})
.option('n', {
alias: 'nightly',
type: 'boolean',
default: false,
}).argv;

const nightlyBuild = argv.nightly;
const ci = argv.ci;

let version, branch;
if (nightlyBuild) {
Expand All @@ -42,7 +47,7 @@ if (nightlyBuild) {
silent: true,
}).stdout.trim();

if (branch.indexOf('-stable') === -1) {
if (!ci && branch.indexOf('-stable') === -1) {
echo('You must be in 0.XX-stable branch to bump a version');
exit(1);
}
Expand Down
Loading