@applicaster/zapplicaster-cli
Version:
CLI Tool for the zapp app and Quick Brick project
30 lines (24 loc) • 1.06 kB
JavaScript
/* eslint-disable max-len */
const R = require("ramda");
const logger = require("../../logger");
async function checkWorkspaceDependencies(configuration) {
const { platform, deviceTarget } = configuration;
const workspacePackage = require(`${process.cwd()}/package.json`);
const rnVersion = workspacePackage.dependencies["react-native"];
if (platform !== "ios") return true;
if (R.includes("tvos", rnVersion)) {
if (deviceTarget !== "apple_tv") {
logger.warn(
`Warning!\nWe've detected that you're running ${deviceTarget} app and your workspace package.json is requesting TV react-native dependency.\nPlease run: yarn add react-native@0.68.6`
);
}
} else {
if (deviceTarget === "apple_tv") {
logger.warn(
`Warning!\nWe've detected that you're running ${deviceTarget} app and your workspace package.json is requesting mobile react-native dependency.\nPlease run: yarn add react-native:react-native-tvos@0.68.2-7`
);
}
}
return true;
}
module.exports = { checkWorkspaceDependencies };