Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/frontend-config / scripts / validateProject.js
Size: Mime:
const assert = require('assert');
const fs = require('fs');
const path = require('path');

const packageJson = require('../package.json');

/**
 * This script checks that the project that depends on this common
 * configuration has all the files that are required to work properly.
 */

console.log('\n**************************************');
console.log('** DOODLE FRONTEND CONFIG VALIDATOR **');
console.log('**************************************\n');

assert(typeof packageJson.main === 'string', 'Webpack: The package.json should contain a main entrypoint.');

assert(
  fs.existsSync(path.resolve(process.cwd(), packageJson.main)),
  `Webpack: The javascript entrypoint ${packageJson} is missing inside the src folder.`
);

assert(
  fs.existsSync(path.resolve(process.cwd(), 'src/index.ejs')),
  'Webpack: The template entrypoint index.ejs is missing inside the src folder.'
);

assert(
  fs.existsSync(path.resolve(process.cwd(), '.prettierrc.js')),
  'Prettier: A .prettierrc.js file is missing in the root folder.'
);

assert(
  fs.existsSync(path.resolve(process.cwd(), '.eslintrc.js')),
  'ESLint: A .eslintrc.js file is missing in the root folder.'
);