From cd49e86e7bb698c318a776fa9b9142792196942f Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Tue, 5 Jan 2021 12:12:45 -0800 Subject: [PATCH] Move some packages from @rnw-scripts to @react-native-windows (#6811) * Move some packages from @rnw-scripts to @react-native-windows These are now being used by product code (e.g. @react-native-windows/cli). Move them to the versioning scheme and naming scheme of other product code, which will also let us backport a change dependent on using package utils. * Change files --- .unbroken_exclusions | 2 +- ...i-42e6acf4-e473-4892-8e56-317f6f8b0815.json | 7 +++++++ ...t-5467d4dd-02f5-445d-bca1-635d027708da.json | 7 +++++++ ...s-7ef3520d-a0b7-4223-8df0-2b30df8f5b7b.json | 7 +++++++ ...s-317526c6-9182-45c5-9585-0da9de7c8106.json | 7 +++++++ ...n-e68cdc8e-2275-4b5c-b58a-bb9c54db0c4a.json | 7 +++++++ ...e-da266ffb-5fd4-4089-a204-7a21c428abb7.json | 7 +++++++ ...e-e81a6bf6-4994-4200-9e26-163a9065475e.json | 7 +++++++ .../@react-native-windows/cli/package.json | 2 +- .../cli/src/generator-windows/index.ts | 5 ++++- .../find-repo-root/.eslintrc.js | 0 .../find-repo-root/.gitignore | 0 .../find-repo-root/just-task.js | 0 .../find-repo-root/package.json | 10 +++++++--- .../find-repo-root/src/findRepoRoot.ts | 0 .../find-repo-root/tsconfig.json | 0 .../package-utils/.eslintrc.js | 0 .../package-utils/.gitignore | 0 .../package-utils/just-task.js | 0 .../package-utils/package.json | 12 ++++++++---- .../package-utils/src/packageUtils.ts | 10 ++++------ .../package-utils/tsconfig.json | 0 .../create-github-releases/package.json | 2 +- .../src/createGithubReleases.ts | 2 +- .../@rnw-scripts/integrate-rn/package.json | 4 ++-- .../integrate-rn/src/integrateRN.ts | 6 +++--- .../integrate-rn/src/runCommand.ts | 2 +- .../integrate-rn/src/upgradeDependencies.ts | 18 +++++++++--------- .../@rnw-scripts/promote-release/package.json | 4 ++-- .../promote-release/src/promoteRelease.ts | 12 ++++++------ .../package.json | 4 ++-- .../src/FileSearch.ts | 4 ++-- 32 files changed, 103 insertions(+), 45 deletions(-) create mode 100644 change/@react-native-windows-cli-42e6acf4-e473-4892-8e56-317f6f8b0815.json create mode 100644 change/@react-native-windows-find-repo-root-5467d4dd-02f5-445d-bca1-635d027708da.json create mode 100644 change/@react-native-windows-package-utils-7ef3520d-a0b7-4223-8df0-2b30df8f5b7b.json create mode 100644 change/@rnw-scripts-create-github-releases-317526c6-9182-45c5-9585-0da9de7c8106.json create mode 100644 change/@rnw-scripts-integrate-rn-e68cdc8e-2275-4b5c-b58a-bb9c54db0c4a.json create mode 100644 change/@rnw-scripts-promote-release-da266ffb-5fd4-4089-a204-7a21c428abb7.json create mode 100644 change/react-native-platform-override-e81a6bf6-4994-4200-9e26-163a9065475e.json rename packages/{@rnw-scripts => @react-native-windows}/find-repo-root/.eslintrc.js (100%) rename packages/{@rnw-scripts => @react-native-windows}/find-repo-root/.gitignore (100%) rename packages/{@rnw-scripts => @react-native-windows}/find-repo-root/just-task.js (100%) rename packages/{@rnw-scripts => @react-native-windows}/find-repo-root/package.json (79%) rename packages/{@rnw-scripts => @react-native-windows}/find-repo-root/src/findRepoRoot.ts (100%) rename packages/{@rnw-scripts => @react-native-windows}/find-repo-root/tsconfig.json (100%) rename packages/{@rnw-scripts => @react-native-windows}/package-utils/.eslintrc.js (100%) rename packages/{@rnw-scripts => @react-native-windows}/package-utils/.gitignore (100%) rename packages/{@rnw-scripts => @react-native-windows}/package-utils/just-task.js (100%) rename packages/{@rnw-scripts => @react-native-windows}/package-utils/package.json (75%) rename packages/{@rnw-scripts => @react-native-windows}/package-utils/src/packageUtils.ts (94%) rename packages/{@rnw-scripts => @react-native-windows}/package-utils/tsconfig.json (100%) diff --git a/.unbroken_exclusions b/.unbroken_exclusions index f0ef5994fd..3d586bd088 100644 --- a/.unbroken_exclusions +++ b/.unbroken_exclusions @@ -11,8 +11,8 @@ !packages/react-native-windows-init/node_modules !packages/rnpm-plugin-windows/node_modules !packages/scripts/node_modules +!packages/@react-native-windows/find-repo-root/node_modules !packages/@rnw-scripts/create-github-releases/node_modules -!packages/@rnw-scripts/find-repo-root/node_modules !packages/@rnw-scripts/format-files/node_modules !packages/@rnw-scripts/promote-release/node_modules !.github/ISSUE_TEMPLATE \ No newline at end of file diff --git a/change/@react-native-windows-cli-42e6acf4-e473-4892-8e56-317f6f8b0815.json b/change/@react-native-windows-cli-42e6acf4-e473-4892-8e56-317f6f8b0815.json new file mode 100644 index 0000000000..8803a1d448 --- /dev/null +++ b/change/@react-native-windows-cli-42e6acf4-e473-4892-8e56-317f6f8b0815.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Move some packages from @rnw-scripts to @react-native-windows", + "packageName": "@react-native-windows/cli", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-find-repo-root-5467d4dd-02f5-445d-bca1-635d027708da.json b/change/@react-native-windows-find-repo-root-5467d4dd-02f5-445d-bca1-635d027708da.json new file mode 100644 index 0000000000..6d0c185307 --- /dev/null +++ b/change/@react-native-windows-find-repo-root-5467d4dd-02f5-445d-bca1-635d027708da.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Move some packages from @rnw-scripts to @react-native-windows", + "packageName": "@react-native-windows/find-repo-root", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@react-native-windows-package-utils-7ef3520d-a0b7-4223-8df0-2b30df8f5b7b.json b/change/@react-native-windows-package-utils-7ef3520d-a0b7-4223-8df0-2b30df8f5b7b.json new file mode 100644 index 0000000000..56bf4ce73a --- /dev/null +++ b/change/@react-native-windows-package-utils-7ef3520d-a0b7-4223-8df0-2b30df8f5b7b.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Move some packages from @rnw-scripts to @react-native-windows", + "packageName": "@react-native-windows/package-utils", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@rnw-scripts-create-github-releases-317526c6-9182-45c5-9585-0da9de7c8106.json b/change/@rnw-scripts-create-github-releases-317526c6-9182-45c5-9585-0da9de7c8106.json new file mode 100644 index 0000000000..af93e74ef6 --- /dev/null +++ b/change/@rnw-scripts-create-github-releases-317526c6-9182-45c5-9585-0da9de7c8106.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Move some packages from @rnw-scripts to @react-native-windows", + "packageName": "@rnw-scripts/create-github-releases", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@rnw-scripts-integrate-rn-e68cdc8e-2275-4b5c-b58a-bb9c54db0c4a.json b/change/@rnw-scripts-integrate-rn-e68cdc8e-2275-4b5c-b58a-bb9c54db0c4a.json new file mode 100644 index 0000000000..fb78035b75 --- /dev/null +++ b/change/@rnw-scripts-integrate-rn-e68cdc8e-2275-4b5c-b58a-bb9c54db0c4a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Move some packages from @rnw-scripts to @react-native-windows", + "packageName": "@rnw-scripts/integrate-rn", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@rnw-scripts-promote-release-da266ffb-5fd4-4089-a204-7a21c428abb7.json b/change/@rnw-scripts-promote-release-da266ffb-5fd4-4089-a204-7a21c428abb7.json new file mode 100644 index 0000000000..a31fb4f27d --- /dev/null +++ b/change/@rnw-scripts-promote-release-da266ffb-5fd4-4089-a204-7a21c428abb7.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Move some packages from @rnw-scripts to @react-native-windows", + "packageName": "@rnw-scripts/promote-release", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-platform-override-e81a6bf6-4994-4200-9e26-163a9065475e.json b/change/react-native-platform-override-e81a6bf6-4994-4200-9e26-163a9065475e.json new file mode 100644 index 0000000000..6e40af46e7 --- /dev/null +++ b/change/react-native-platform-override-e81a6bf6-4994-4200-9e26-163a9065475e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Move some packages from @rnw-scripts to @react-native-windows", + "packageName": "react-native-platform-override", + "email": "ngerlem@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/@react-native-windows/cli/package.json b/packages/@react-native-windows/cli/package.json index 6a44872db0..a83f2ba635 100644 --- a/packages/@react-native-windows/cli/package.json +++ b/packages/@react-native-windows/cli/package.json @@ -17,8 +17,8 @@ "watch": "just-scripts watch" }, "dependencies": { + "@react-native-windows/package-utils": "^0.0.0-canary.11", "@react-native-windows/telemetry": "^0.0.0-canary.12", - "@rnw-scripts/package-utils": "^0.0.11", "chalk": "^4.1.0", "cli-spinners": "^2.2.0", "envinfo": "^7.5.0", diff --git a/packages/@react-native-windows/cli/src/generator-windows/index.ts b/packages/@react-native-windows/cli/src/generator-windows/index.ts index d314d27f64..d5f487728b 100644 --- a/packages/@react-native-windows/cli/src/generator-windows/index.ts +++ b/packages/@react-native-windows/cli/src/generator-windows/index.ts @@ -22,7 +22,10 @@ import { } from '../generator-common'; import {GenerateOptions} from '..'; import {CodedError} from '@react-native-windows/telemetry'; -import {findPackage, WritableNpmPackage} from '@rnw-scripts/package-utils'; +import { + findPackage, + WritableNpmPackage, +} from '@react-native-windows/package-utils'; const windowsDir = 'windows'; const bundleDir = 'Bundle'; diff --git a/packages/@rnw-scripts/find-repo-root/.eslintrc.js b/packages/@react-native-windows/find-repo-root/.eslintrc.js similarity index 100% rename from packages/@rnw-scripts/find-repo-root/.eslintrc.js rename to packages/@react-native-windows/find-repo-root/.eslintrc.js diff --git a/packages/@rnw-scripts/find-repo-root/.gitignore b/packages/@react-native-windows/find-repo-root/.gitignore similarity index 100% rename from packages/@rnw-scripts/find-repo-root/.gitignore rename to packages/@react-native-windows/find-repo-root/.gitignore diff --git a/packages/@rnw-scripts/find-repo-root/just-task.js b/packages/@react-native-windows/find-repo-root/just-task.js similarity index 100% rename from packages/@rnw-scripts/find-repo-root/just-task.js rename to packages/@react-native-windows/find-repo-root/just-task.js diff --git a/packages/@rnw-scripts/find-repo-root/package.json b/packages/@react-native-windows/find-repo-root/package.json similarity index 79% rename from packages/@rnw-scripts/find-repo-root/package.json rename to packages/@react-native-windows/find-repo-root/package.json index 3427192e14..5b3a005400 100644 --- a/packages/@rnw-scripts/find-repo-root/package.json +++ b/packages/@react-native-windows/find-repo-root/package.json @@ -1,6 +1,6 @@ { - "name": "@rnw-scripts/find-repo-root", - "version": "0.0.14", + "name": "@react-native-windows/find-repo-root", + "version": "0.0.0-canary.14", "license": "MIT", "scripts": { "build": "just-scripts build", @@ -24,10 +24,14 @@ "typescript": "^3.8.3" }, "beachball": { + "defaultNpmTag": "canary", "disallowedChangeTypes": [ - "major" + "major", + "minor", + "patch" ] }, + "promoteRelease": true, "files": [ "lib-commonjs" ] diff --git a/packages/@rnw-scripts/find-repo-root/src/findRepoRoot.ts b/packages/@react-native-windows/find-repo-root/src/findRepoRoot.ts similarity index 100% rename from packages/@rnw-scripts/find-repo-root/src/findRepoRoot.ts rename to packages/@react-native-windows/find-repo-root/src/findRepoRoot.ts diff --git a/packages/@rnw-scripts/find-repo-root/tsconfig.json b/packages/@react-native-windows/find-repo-root/tsconfig.json similarity index 100% rename from packages/@rnw-scripts/find-repo-root/tsconfig.json rename to packages/@react-native-windows/find-repo-root/tsconfig.json diff --git a/packages/@rnw-scripts/package-utils/.eslintrc.js b/packages/@react-native-windows/package-utils/.eslintrc.js similarity index 100% rename from packages/@rnw-scripts/package-utils/.eslintrc.js rename to packages/@react-native-windows/package-utils/.eslintrc.js diff --git a/packages/@rnw-scripts/package-utils/.gitignore b/packages/@react-native-windows/package-utils/.gitignore similarity index 100% rename from packages/@rnw-scripts/package-utils/.gitignore rename to packages/@react-native-windows/package-utils/.gitignore diff --git a/packages/@rnw-scripts/package-utils/just-task.js b/packages/@react-native-windows/package-utils/just-task.js similarity index 100% rename from packages/@rnw-scripts/package-utils/just-task.js rename to packages/@react-native-windows/package-utils/just-task.js diff --git a/packages/@rnw-scripts/package-utils/package.json b/packages/@react-native-windows/package-utils/package.json similarity index 75% rename from packages/@rnw-scripts/package-utils/package.json rename to packages/@react-native-windows/package-utils/package.json index 34484e470f..5c401000ee 100644 --- a/packages/@rnw-scripts/package-utils/package.json +++ b/packages/@react-native-windows/package-utils/package.json @@ -1,6 +1,6 @@ { - "name": "@rnw-scripts/package-utils", - "version": "0.0.11", + "name": "@react-native-windows/package-utils", + "version": "0.0.0-canary.11", "license": "MIT", "scripts": { "build": "just-scripts build", @@ -11,7 +11,7 @@ }, "main": "lib-commonjs/packageUtils.js", "dependencies": { - "@rnw-scripts/find-repo-root": "^0.0.14", + "@react-native-windows/find-repo-root": "^0.0.0-canary.14", "get-monorepo-packages": "^1.2.0", "lodash": "^4.17.15" }, @@ -26,10 +26,14 @@ "typescript": "^3.8.3" }, "beachball": { + "defaultNpmTag": "canary", "disallowedChangeTypes": [ - "major" + "major", + "minor", + "patch" ] }, + "promoteRelease": true, "files": [ "lib-commonjs" ] diff --git a/packages/@rnw-scripts/package-utils/src/packageUtils.ts b/packages/@react-native-windows/package-utils/src/packageUtils.ts similarity index 94% rename from packages/@rnw-scripts/package-utils/src/packageUtils.ts rename to packages/@react-native-windows/package-utils/src/packageUtils.ts index 95d2a68fce..3e62feaa5a 100644 --- a/packages/@rnw-scripts/package-utils/src/packageUtils.ts +++ b/packages/@react-native-windows/package-utils/src/packageUtils.ts @@ -8,7 +8,7 @@ import * as _ from 'lodash'; import * as fs from 'fs'; import * as path from 'path'; -import findRepoRoot from '@rnw-scripts/find-repo-root'; +import findRepoRoot from '@react-native-windows/find-repo-root'; const getMonorepoPackages: ( root: string, @@ -105,7 +105,7 @@ export class WritableNpmPackage extends NpmPackage { * * @param pred predicate describing whether to match a package */ -export async function enumerateLocalPackages( +export async function enumerateRepoPackages( pred: (pkg: NpmPackage) => Promise = async () => true, ): Promise { const repoRoot = await findRepoRoot(); @@ -154,12 +154,10 @@ export async function findPackage( /** * Finds a monorepo-local package with a given name */ -export async function findLocalPackage( +export async function findRepoPackage( name: string, ): Promise { - const packages = await enumerateLocalPackages( - async p => p.json.name === name, - ); + const packages = await enumerateRepoPackages(async p => p.json.name === name); if (packages.length === 0) { return null; diff --git a/packages/@rnw-scripts/package-utils/tsconfig.json b/packages/@react-native-windows/package-utils/tsconfig.json similarity index 100% rename from packages/@rnw-scripts/package-utils/tsconfig.json rename to packages/@react-native-windows/package-utils/tsconfig.json diff --git a/packages/@rnw-scripts/create-github-releases/package.json b/packages/@rnw-scripts/create-github-releases/package.json index a4430354f2..f5410de04f 100644 --- a/packages/@rnw-scripts/create-github-releases/package.json +++ b/packages/@rnw-scripts/create-github-releases/package.json @@ -13,7 +13,7 @@ "create-github-releases": "./bin.js" }, "dependencies": { - "@rnw-scripts/find-repo-root": "^0.0.14", + "@react-native-windows/find-repo-root": "^0.0.0-canary.14", "chalk": "^4.1.0", "glob": "^7.1.6", "lodash": "^4.17.15", diff --git a/packages/@rnw-scripts/create-github-releases/src/createGithubReleases.ts b/packages/@rnw-scripts/create-github-releases/src/createGithubReleases.ts index 9b12f6f988..c41f0da1d0 100644 --- a/packages/@rnw-scripts/create-github-releases/src/createGithubReleases.ts +++ b/packages/@rnw-scripts/create-github-releases/src/createGithubReleases.ts @@ -19,7 +19,7 @@ import * as util from 'util'; import * as yargs from 'yargs'; import fetch from 'node-fetch'; -import findRepoRoot from '@rnw-scripts/find-repo-root'; +import findRepoRoot from '@react-native-windows/find-repo-root'; const glob = util.promisify(require('glob').glob); diff --git a/packages/@rnw-scripts/integrate-rn/package.json b/packages/@rnw-scripts/integrate-rn/package.json index 1f77a782c3..f0d30115c5 100644 --- a/packages/@rnw-scripts/integrate-rn/package.json +++ b/packages/@rnw-scripts/integrate-rn/package.json @@ -14,8 +14,8 @@ "integrate-rn": "./bin.js" }, "dependencies": { - "@rnw-scripts/find-repo-root": "^0.0.14", - "@rnw-scripts/package-utils": "^0.0.11", + "@react-native-windows/find-repo-root": "^0.0.0-canary.14", + "@react-native-windows/package-utils": "^0.0.0-canary.11", "async": "^3.2.0", "lodash": "^4.17.15", "ora": "^3.4.0", diff --git a/packages/@rnw-scripts/integrate-rn/src/integrateRN.ts b/packages/@rnw-scripts/integrate-rn/src/integrateRN.ts index 3e5134f188..1d49cd37f9 100644 --- a/packages/@rnw-scripts/integrate-rn/src/integrateRN.ts +++ b/packages/@rnw-scripts/integrate-rn/src/integrateRN.ts @@ -12,10 +12,10 @@ import * as semver from 'semver'; import * as yargs from 'yargs'; import { - enumerateLocalPackages, + enumerateRepoPackages, NpmPackage, WritableNpmPackage, -} from '@rnw-scripts/package-utils'; +} from '@react-native-windows/package-utils'; import { upgradeOverrides, @@ -59,7 +59,7 @@ import upgradeDependencies from './upgradeDependencies'; * Enumerate packages subject to override validation */ async function enumerateOverridePackages(): Promise { - return await enumerateLocalPackages(isOverridePackage); + return await enumerateRepoPackages(isOverridePackage); } /** diff --git a/packages/@rnw-scripts/integrate-rn/src/runCommand.ts b/packages/@rnw-scripts/integrate-rn/src/runCommand.ts index d5f176ebaa..4ecbc756d3 100644 --- a/packages/@rnw-scripts/integrate-rn/src/runCommand.ts +++ b/packages/@rnw-scripts/integrate-rn/src/runCommand.ts @@ -6,7 +6,7 @@ */ import {exec, ExecOptions} from 'child_process'; -import findRepoRoot from '@rnw-scripts/find-repo-root'; +import findRepoRoot from '@react-native-windows/find-repo-root'; /** * Run a command asyncronously, setting cwd to repo root if none is specified diff --git a/packages/@rnw-scripts/integrate-rn/src/upgradeDependencies.ts b/packages/@rnw-scripts/integrate-rn/src/upgradeDependencies.ts index 3f7e697ce6..bc8a1b535a 100644 --- a/packages/@rnw-scripts/integrate-rn/src/upgradeDependencies.ts +++ b/packages/@rnw-scripts/integrate-rn/src/upgradeDependencies.ts @@ -9,10 +9,10 @@ import * as _ from 'lodash'; import * as path from 'path'; import * as semver from 'semver'; import { - enumerateLocalPackages, + enumerateRepoPackages, findPackage, - findLocalPackage, -} from '@rnw-scripts/package-utils'; + findRepoPackage, +} from '@react-native-windows/package-utils'; import runCommand from './runCommand'; import {upgradeOverrides} from 'react-native-platform-override'; @@ -60,7 +60,7 @@ export default async function upgradeDependencies( ) { const reactNativeDiff = await upgradeReactNative(newReactNativeVersion); const repoConfigDiff = await upgradeRepoConfig(newReactNativeVersion); - const localPackages = (await enumerateLocalPackages()).map(pkg => ({ + const localPackages = (await enumerateRepoPackages()).map(pkg => ({ ...extractPackageDeps(pkg.json), outOfTreePlatform: OUT_OF_TREE_PLATFORMS.includes(pkg.json.name), })); @@ -72,7 +72,7 @@ export default async function upgradeDependencies( localPackages, ); - const writablePackages = await enumerateLocalPackages(); + const writablePackages = await enumerateRepoPackages(); await Promise.all( newDeps.map(async deps => { const [writablePackage] = writablePackages.filter( @@ -111,7 +111,7 @@ export default async function upgradeDependencies( async function upgradeReactNative( newReactNativeVersion: string, ): Promise { - const platformPackages = await enumerateLocalPackages(async pkg => + const platformPackages = await enumerateRepoPackages(async pkg => OUT_OF_TREE_PLATFORMS.includes(pkg.json.name), ); @@ -124,7 +124,7 @@ async function upgradeReactNative( const findRnOpts = {searchPath: platformPackages[0].path}; const origJson = (await findPackage('react-native', findRnOpts))!.json; - for (const pkg of await enumerateLocalPackages()) { + for (const pkg of await enumerateRepoPackages()) { if (pkg.json.dependencies && pkg.json.dependencies['react-native']) { await pkg.mergeProps({ dependencies: { @@ -160,7 +160,7 @@ async function upgradeReactNative( async function upgradeRepoConfig( newReactNativeVersion: string, ): Promise { - const origPackage = (await findLocalPackage('@react-native/repo-config'))!; + const origPackage = (await findRepoPackage('@react-native/repo-config'))!; const upgradeResults = await upgradeOverrides( path.join(origPackage.path, 'overrides.json'), @@ -176,7 +176,7 @@ async function upgradeRepoConfig( ); } - const newPackage = (await findLocalPackage('@react-native/repo-config'))!; + const newPackage = (await findRepoPackage('@react-native/repo-config'))!; return extractPackageDiff(origPackage.json, newPackage.json); } diff --git a/packages/@rnw-scripts/promote-release/package.json b/packages/@rnw-scripts/promote-release/package.json index ba222a2348..dd8701e4d4 100644 --- a/packages/@rnw-scripts/promote-release/package.json +++ b/packages/@rnw-scripts/promote-release/package.json @@ -13,8 +13,8 @@ "promote-release": "./bin.js" }, "dependencies": { - "@rnw-scripts/find-repo-root": "^0.0.14", - "@rnw-scripts/package-utils": "^0.0.11", + "@react-native-windows/find-repo-root": "^0.0.0-canary.14", + "@react-native-windows/package-utils": "^0.0.0-canary.11", "chalk": "^4.1.0", "simple-git": "^1.131.0", "yargs": "^15.4.1" diff --git a/packages/@rnw-scripts/promote-release/src/promoteRelease.ts b/packages/@rnw-scripts/promote-release/src/promoteRelease.ts index 05757eebf4..c2b3981f2f 100644 --- a/packages/@rnw-scripts/promote-release/src/promoteRelease.ts +++ b/packages/@rnw-scripts/promote-release/src/promoteRelease.ts @@ -18,10 +18,10 @@ import * as simplegit from 'simple-git/promise'; import * as yargs from 'yargs'; import { - enumerateLocalPackages, + enumerateRepoPackages, WritableNpmPackage, -} from '@rnw-scripts/package-utils'; -import findRepoRoot from '@rnw-scripts/find-repo-root'; +} from '@react-native-windows/package-utils'; +import findRepoRoot from '@react-native-windows/find-repo-root'; type ReleaseType = 'preview' | 'latest' | 'legacy'; @@ -155,7 +155,7 @@ async function updateBeachballConfig( * Finds packages where we need to update version number + beachball config */ async function enumeratePackagesToPromote(): Promise { - return enumerateLocalPackages(async pkg => pkg.json.promoteRelease === true); + return enumerateRepoPackages(async pkg => pkg.json.promoteRelease === true); } /** @@ -186,7 +186,7 @@ async function updatePackageVersions(version: string) { // We need to update anything that might have a dependency on what we just // bumped. - for (const pkg of await enumerateLocalPackages()) { + for (const pkg of await enumerateRepoPackages()) { for (const field of [ 'dependencies', 'peerDependencies', @@ -214,7 +214,7 @@ async function updatePackageVersions(version: string) { * ensure we do not depend on any of these in our published packages. */ async function markMasterPackagesPrivate() { - const masterPublishedPackages = await enumerateLocalPackages( + const masterPublishedPackages = await enumerateRepoPackages( async pkg => !pkg.json.promoteRelease && !pkg.json.private, ); diff --git a/packages/react-native-platform-override/package.json b/packages/react-native-platform-override/package.json index c57d88f71b..bddd915d9d 100644 --- a/packages/react-native-platform-override/package.json +++ b/packages/react-native-platform-override/package.json @@ -22,7 +22,7 @@ "react-native-platform-override": "./bin.js" }, "dependencies": { - "@rnw-scripts/package-utils": "^0.0.11", + "@react-native-windows/package-utils": "^0.0.0-canary.11", "async": "^3.2.0", "chalk": "^4.1.0", "fp-ts": "^2.5.0", @@ -45,7 +45,7 @@ "@rnw-scripts/eslint-config": "0.1.6", "@rnw-scripts/jest-unittest-config": "0.1.1", "@rnw-scripts/just-task": "0.0.6", - "@rnw-scripts/package-utils": "0.0.11", + "@react-native-windows/package-utils": "0.0.11", "@rnw-scripts/ts-config": "0.1.0", "@types/async": "^3.2.3", "@types/chalk": "^2.2.0", diff --git a/packages/react-native-platform-override/src/FileSearch.ts b/packages/react-native-platform-override/src/FileSearch.ts index 5e5fa11755..e3206e3531 100644 --- a/packages/react-native-platform-override/src/FileSearch.ts +++ b/packages/react-native-platform-override/src/FileSearch.ts @@ -7,7 +7,7 @@ import * as fs from 'fs'; import * as path from 'path'; -import {enumerateLocalPackages} from '@rnw-scripts/package-utils'; +import {enumerateRepoPackages} from '@react-native-windows/package-utils'; /** * Search for a single manifest adjacent to the package above a directory or @@ -45,7 +45,7 @@ export async function findAllManifests(): Promise { return [path.join(packageDir, 'overrides.json')]; } - const localPackages = await enumerateLocalPackages(pkg => + const localPackages = await enumerateRepoPackages(pkg => exists(path.join(pkg.path, 'overrides.json')), );