Repository URL to install this package:
|
Version:
4.0.2-5643ffcf5e86a4 ▾
|
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.'
);