diff --git a/packages/nx-release-version/index.js b/packages/nx-release-version/index.js index 47d00ee01aed..f34d124080ad 100644 --- a/packages/nx-release-version/index.js +++ b/packages/nx-release-version/index.js @@ -64,6 +64,16 @@ async function runSetVersion() { 'Core', 'ReactNativeVersion.js', ), + path.join( + REPO_ROOT, + 'packages', + 'react-native', + 'scripts', + 'codegen', + '__tests__', + '__snapshots__', + 'generate-artifacts-executor-test.js.snap', + ), ]; } diff --git a/packages/nx-release-version/package.json b/packages/nx-release-version/package.json index e9bf940e49d1..c0043f1a426d 100644 --- a/packages/nx-release-version/package.json +++ b/packages/nx-release-version/package.json @@ -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", diff --git a/packages/virtualized-lists/package.json b/packages/virtualized-lists/package.json index 216d8442942a..c5ff43fcfe0c 100644 --- a/packages/virtualized-lists/package.json +++ b/packages/virtualized-lists/package.json @@ -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": { diff --git a/private/eslint-plugin-monorepo/rules/__tests__/react-native-manifest-test.js b/private/eslint-plugin-monorepo/rules/__tests__/react-native-manifest-test.js index c0ec67da127b..bfa555d3e70a 100644 --- a/private/eslint-plugin-monorepo/rules/__tests__/react-native-manifest-test.js +++ b/private/eslint-plugin-monorepo/rules/__tests__/react-native-manifest-test.js @@ -36,8 +36,9 @@ 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', }, @@ -45,7 +46,7 @@ ruleTester.run('react-native-manifest', rule, { }, { code: JSON.stringify({ - name: 'react-native', + name: 'react-native-macos', dependencies: { dependencyA: '1.0.0', }, @@ -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', }, @@ -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', }, diff --git a/private/eslint-plugin-monorepo/rules/react-native-manifest.js b/private/eslint-plugin-monorepo/rules/react-native-manifest.js index ff073946ac17..428af1f1b776 100644 --- a/private/eslint-plugin-monorepo/rules/react-native-manifest.js +++ b/private/eslint-plugin-monorepo/rules/react-native-manifest.js @@ -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', @@ -27,7 +28,7 @@ const PACKAGE_CONSTRAINTS = { }, ], }, - 'react-native': { + 'react-native-macos': { disallowed: [ { property: 'devDependencies', diff --git a/yarn.config.cjs b/yarn.config.cjs index bffe9b7c2759..968b0d29ca35 100644 --- a/yarn.config.cjs +++ b/yarn.config.cjs @@ -158,6 +158,25 @@ 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); @@ -165,5 +184,6 @@ module.exports = defineConfig({ enforceReactNativeDependencyConsistency(ctx); enforceReactNativeMacosVersionConsistency(ctx); enforceReactNativeMacOSDependencyConsistency(ctx); + enforceReactNativeMacosPrivatePackageVersion(ctx); }, }); \ No newline at end of file