Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion packages/nx-release-version/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-macos/nx-release-version",
"version": "0.0.1-dev",
"version": "0.1.0",
"private": true,
"description": "Nx Release Version Actions for React Native macOS",
"homepage": "https://github.com/microsoft/react-native-macos/tree/HEAD/packages/nx-release-version#readme",
Expand Down
1 change: 0 additions & 1 deletion packages/virtualized-lists/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@react-native-macos/virtualized-lists",
"version": "0.81.0-main",
"private": true,
"description": "Virtualized lists for React Native macOS.",
"license": "MIT",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ ruleTester.run('react-native-manifest', rule, {
}),
},
{
// [macOS] Use fork package names
code: JSON.stringify({
name: '@react-native/monorepo',
name: '@react-native-macos/monorepo',
devDependencies: {
dependencyB: '1.0.0',
},
}),
},
{
code: JSON.stringify({
name: 'react-native',
name: 'react-native-macos',
dependencies: {
dependencyA: '1.0.0',
},
Expand All @@ -54,8 +55,9 @@ ruleTester.run('react-native-manifest', rule, {
],
invalid: [
{
// [macOS] Use fork package names
code: JSON.stringify({
name: '@react-native/monorepo',
name: '@react-native-macos/monorepo',
dependencies: {
dependencyA: '1.0.0',
},
Expand All @@ -73,7 +75,7 @@ ruleTester.run('react-native-manifest', rule, {
},
{
code: JSON.stringify({
name: 'react-native',
name: 'react-native-macos',
devDependencies: {
dependencyA: '1.0.0',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* (which depends on the `react-native` package).
*/
const PACKAGE_CONSTRAINTS = {
'@react-native/monorepo': {
// [macOS] Use fork package names instead of upstream names
'@react-native-macos/monorepo': {
disallowed: [
{
property: 'dependencies',
Expand All @@ -27,7 +28,7 @@ const PACKAGE_CONSTRAINTS = {
},
],
},
'react-native': {
'react-native-macos': {
disallowed: [
{
property: 'devDependencies',
Expand Down
20 changes: 20 additions & 0 deletions yarn.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,32 @@ function enforceReactNativeMacOSDependencyConsistency({Yarn}) {
}
}

/**
* Enforce that private @react-native-macos/ scoped packages (i.e. internal
* tooling that is not forked from upstream) have a fixed version of 0.1.0.
* These packages do not track the react-native-macos release version.
* @param {Context} context
*/
function enforceReactNativeMacosPrivatePackageVersion({Yarn}) {
if (!isMainBranch({Yarn})) {
for (const workspace of Yarn.workspaces()) {
const isReactNativeMacosScoped = workspace.ident?.startsWith('@react-native-macos/');
const isPrivate = workspace.manifest.private;

if (isReactNativeMacosScoped && isPrivate) {
workspace.set('version', '0.1.0');
}
}
}
}

module.exports = defineConfig({
constraints: async ctx => {
enforcePrivateReactNativeScopedPackages(ctx);
enforceReactNativeVersionConsistency(ctx);
enforceReactNativeDependencyConsistency(ctx);
enforceReactNativeMacosVersionConsistency(ctx);
enforceReactNativeMacOSDependencyConsistency(ctx);
enforceReactNativeMacosPrivatePackageVersion(ctx);
},
});
Loading