UNPKG

@nx/expo

Version:

The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.

37 lines (36 loc) 1.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeOptions = normalizeOptions; const devkit_1 = require("@nx/devkit"); const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils"); const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup"); async function normalizeOptions(host, options) { const { artifactName: name, fileName, fileExtension, fileExtensionType, filePath, directory, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(host, { name: options.name, path: options.path, allowedFileExtensions: ['js', 'jsx', 'ts', 'tsx'], fileExtension: options.js ? 'js' : 'tsx', js: options.js, }); const { className } = (0, devkit_1.names)(name); const project = (0, devkit_1.getProjects)(host).get(projectName); const { root, sourceRoot: projectSourceRoot, projectType } = project; if (options.export && (0, ts_solution_setup_1.getProjectType)(host, root, projectType) === 'application') { devkit_1.logger.warn(`The "--export" option should not be used with applications and will do nothing.`); } options.classComponent = options.classComponent ?? false; return { ...options, name, directory, className, fileName, fileExtension, fileExtensionType, filePath, projectSourceRoot, projectName, projectRoot: root, }; }