fix(visionos): declare support for 0.74 (#1933)

* fix(visionos): declare support for 0.74

* fixup! fix(visionos): declare support for 0.74

* fix: remove --no-packager as it is currently broken

---------

Co-authored-by: Lorenzo Sciandra <lsciandra@microsoft.com>
This commit is contained in:
Tommy Nguyen 2024-03-25 15:00:09 +01:00 коммит произвёл GitHub
Родитель 0c31391393
Коммит de0723127b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 28 добавлений и 14 удалений

Просмотреть файл

@ -15,6 +15,7 @@
"macos": "react-native run-macos --no-packager --scheme Example",
"set-react-version": "yarn workspace react-native-test-app set-react-version",
"start": "react-native start",
"visionos": "react-native run-visionos",
"windows": "react-native run-windows --no-packager"
},
"dependencies": {

Просмотреть файл

@ -95,7 +95,7 @@
"yoctocolors": "^2.0.0"
},
"peerDependencies": {
"@callstack/react-native-visionos": "0.73",
"@callstack/react-native-visionos": "0.73 - 0.74",
"@expo/config-plugins": ">=5.0",
"react": "17.0.1 - 18.2",
"react-native": "0.66 - 0.74 || >=0.75.0-0 <0.75.0",

Просмотреть файл

@ -348,22 +348,35 @@ async function getProfile(v, coreOnly) {
}
default: {
const [reactNative, { version: rnmVersion }, { version: rnwVersion }] =
await Promise.all([
fetchPackageInfo(`react-native@^${v}.0-0`),
coreOnly
? Promise.resolve({ version: undefined })
: fetchPackageInfo(`react-native-macos@^${v}.0-0`),
coreOnly
? Promise.resolve({ version: undefined })
: fetchPackageInfo(`react-native-windows@^${v}.0-0`),
]);
const manifest = /** @type {Manifest} */ (readJSONFile("package.json"));
const visionos = manifest.defaultPlatformPackages?.["visionos"];
if (!visionos) {
throw new Error("Missing platform package for visionOS");
}
const versions = {
core: fetchPackageInfo(`react-native@^${v}.0-0`),
macos: coreOnly
? Promise.resolve({ version: undefined })
: fetchPackageInfo(`react-native-macos@^${v}.0-0`),
visionos: coreOnly
? Promise.resolve({ version: undefined })
: fetchPackageInfo(`${visionos}@^${v}.0-0`),
windows: coreOnly
? Promise.resolve({ version: undefined })
: fetchPackageInfo(`react-native-windows@^${v}.0-0`),
};
const reactNative = await versions.core;
const commonDeps = await resolveCommonDependencies(v, reactNative);
/** @type {(manifest: Manifest) => string | undefined} */
const getVersion = ({ version }) => version;
return {
...commonDeps,
"react-native": reactNative.version,
"react-native-macos": rnmVersion,
"react-native-windows": rnwVersion,
"react-native-macos": await versions.macos.then(getVersion),
"react-native-windows": await versions.windows.then(getVersion),
[visionos]: await versions.visionos.then(getVersion),
};
}
}

Просмотреть файл

@ -12276,7 +12276,7 @@ __metadata:
uuid: "npm:^9.0.0"
yoctocolors: "npm:^2.0.0"
peerDependencies:
"@callstack/react-native-visionos": 0.73
"@callstack/react-native-visionos": 0.73 - 0.74
"@expo/config-plugins": ">=5.0"
react: 17.0.1 - 18.2
react-native: 0.66 - 0.74 || >=0.75.0-0 <0.75.0