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

fix: declare support for 0.74 #1863

Merged
merged 2 commits into from
Mar 19, 2024
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
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@babel/preset-env": "^7.1.6",
"@react-native/babel-preset": "^0.73.19",
"@react-native/metro-config": "^0.73.3",
"@rnx-kit/metro-config": "^1.3.14",
"@rnx-kit/metro-config": "^1.3.15",
"@rnx-kit/polyfills": "^0.1.1",
"@rnx-kit/tsconfig": "^1.0.0",
"@types/react": "~18.2.0",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"test:rb": "bundle exec ruby -Ilib:test -e \"Dir.glob('./test/test_*.rb').each { |file| require(file) }\""
},
"dependencies": {
"@rnx-kit/react-native-host": "^0.4.4",
"@rnx-kit/react-native-host": "^0.4.5",
"ajv": "^8.0.0",
"cliui": "^8.0.0",
"fast-xml-parser": "^4.0.0",
Expand All @@ -98,7 +98,7 @@
"@callstack/react-native-visionos": "0.73",
"@expo/config-plugins": ">=5.0",
"react": "17.0.1 - 18.2",
"react-native": "^0.0.0-0 || 0.66 - 0.73 || 1000.0.0",
"react-native": "0.66 - 0.74 || >=0.75.0-0 <0.75.0",
"react-native-macos": "^0.0.0-0 || 0.66 || 0.68 || 0.71 - 0.73",
"react-native-windows": "^0.0.0-0 || 0.66 - 0.73"
},
Expand Down Expand Up @@ -152,7 +152,7 @@
"packageManager": "yarn@4.1.0",
"resolutions": {
"@appium/docutils": "link:./example",
"@appium/support/@types/semver": "^7.5.6",
"@appium/support/@types/semver": "^7.5.7",
"@expo/config-plugins/glob": "^7.1.6",
"@expo/json-file/@babel/code-frame": "^7.10.4",
"@microsoft/eslint-plugin-sdl/eslint-plugin-react": "^7.33.0",
Expand All @@ -165,7 +165,7 @@
"@react-native/community-cli-plugin/@react-native-community/cli-server-api": "^12.3.0",
"@react-native/community-cli-plugin/@react-native-community/cli-tools": "^12.3.0",
"@semantic-release/npm/npm": "link:./example",
"appium/@types/semver": "^7.5.6",
"appium/@types/semver": "^7.5.7",
"appium/yaml": "^2.3.4",
"body-parser": "~1.20.2",
"bplist-parser": "~0.3.2",
Expand Down
8 changes: 3 additions & 5 deletions scripts/configure.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,11 @@ export function updatePackageManifest(
dependencies
);

const { name: reactTestAppName, version: reactTestAppVersion } =
readManifest();

const { name: rntaName, version: rntaVersion } = readManifest();
manifest["devDependencies"] = mergeObjects(manifest["devDependencies"], {
"@rnx-kit/metro-config": "^1.3.14",
"@rnx-kit/metro-config": "^1.3.15",
mkdirp: "^1.0.0",
[reactTestAppName]: `^${reactTestAppVersion}`,
[rntaName]: `^${rntaVersion}`,
});

return manifest;
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-e2e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { spawnSync } from "node:child_process";
import { Socket } from "node:net";
import { isMain } from "./helpers";
import { isMain } from "./helpers.js";

/**
* Invokes a shell command with optional arguments.
Expand Down
16 changes: 10 additions & 6 deletions scripts/test-matrix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { setReactVersion } from "./set-react-version.mjs";
import { $, test } from "./test-e2e.mjs";

/**
* @typedef {"android" | "ios"} Platform
* @typedef {"ios" | "macos" | "visionos"} ApplePlatform
* @typedef {ApplePlatform | "android" | "windows"} Platform
*/

const PACKAGE_MANAGER = "yarn";
Expand Down Expand Up @@ -53,8 +54,8 @@ const getIOSSimulatorName = (() => {
};
})();

function log(message = "") {
console.log(TAG, message);
function log(message = "", tag = TAG) {
console.log(tag, message);
}

/**
Expand Down Expand Up @@ -116,7 +117,7 @@ function configure(platform, { hermes, newArch }) {

/**
* Invokes `pod install` for specified platform.
* @param {"ios" | "macos"} platform
* @param {ApplePlatform} platform
*/
function installPods(platform) {
const options = {
Expand Down Expand Up @@ -149,8 +150,8 @@ function run(script, logPath) {
*/
function showBanner(message) {
log();
log(message);
log();
log(message, "┗━━▶");
log("", "");
}

/**
Expand Down Expand Up @@ -188,9 +189,12 @@ async function withReactNativeVersion(version, proc) {

if (version) {
await setReactVersion(version, true);
} else {
log();
}

$(PACKAGE_MANAGER, "install");
log();

let appiumServer;
let devServer;
Expand Down
4 changes: 2 additions & 2 deletions test/configure/getPlatformPackage.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ describe("getPlatformPackage()", () => {
deepEqual(pkg, { [name]: "^0.0.0" });
}

for (const targetVersion of ["0.68", "0.68.2", "^0.68", "^0.68.2"]) {
for (const targetVersion of ["0.73", "0.73.2", "^0.73", "^0.73.2"]) {
const pkg = getPlatformPackage("macos", targetVersion);
deepEqual(pkg, { [name]: "^0.68.0" });
deepEqual(pkg, { [name]: "^0.73.0" });
}

equal(spy(console.warn).calls.length, 0);
Expand Down
12 changes: 11 additions & 1 deletion test/configure/updatePackageManifest.test.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
// @ts-check
import { deepEqual } from "node:assert/strict";
import { afterEach, describe, it } from "node:test";
import { URL } from "node:url";
import { updatePackageManifest as updatePackageManifestActual } from "../../scripts/configure.mjs";
import { readJSONFile } from "../../scripts/helpers.js";
import { fs, setMockFiles } from "../fs.mock.mjs";

function getExampleManifest() {
const p = new URL("../../example/package.json", import.meta.url);
const manifest = readJSONFile(p);
return /** @type {import("../../scripts/types.js").Manifest} */ (manifest);
}

describe("updatePackageManifest()", () => {
/** @type {typeof updatePackageManifestActual} */
const updatePackageManifest = (p, cfg) =>
updatePackageManifestActual(p, cfg, fs);

const exampleManifest = getExampleManifest();
const devDependencies = {
"@rnx-kit/metro-config": "^1.3.14",
"@rnx-kit/metro-config":
exampleManifest["devDependencies"]?.["@rnx-kit/metro-config"],
mkdirp: "^1.0.0",
"react-native-test-app": "^0.0.1-dev",
};
Expand Down
Loading
Loading