UNPKG

roc

Version:

Build modern web applications easily

26 lines (21 loc) 932 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.validRocProject = validRocProject; var _lodash = require('lodash'); var _helpers = require('../../helpers'); /** * Validates if a directory seems to be a Roc application project. * A valid Roc project should have a package.json file that contains some dependency that match 'roc-package-*' or * a `roc.config.js` file. * * @param {string} directory - The directory to validate. * * @returns {boolean} - Whether or not it is a valid Roc project. */ function validRocProject(directory) { const packageJson = (0, _helpers.getPackageJson)(directory); return (0, _lodash.isObject)(packageJson) && ((0, _helpers.fileExists)('roc.config.js', directory) || (0, _helpers.getRocPackageDependencies)(packageJson).length > 0 || (0, _helpers.getRocNamespacedDependencies)(packageJson).length > 0); } //# sourceMappingURL=general.js.map