src/build.js
async function filterFiles(files) {
    const clearModule = replace(/^\.\//, '');
    const resources = files | filter(test(/^((icon\.png)|(README(\.\w+)?\.md))$/));
    const missing = without(files, requiredFiles);

    if (missing.length > 0) {
        return reject(Error(`missing ${missing.join(', ')} from the project`));
    }

    if (!contains('icon.png', files)) {
        emitWarning('compiling app without providing an icon.png file');
    }

    const infoFiles = await listFiles('info')
        | filter(test(/[a-z]{2}(_[A-Z]{2,3})?\.md/))
        | map(path.join('info/', _));

    return fs.readFileAsync('index.js', 'utf-8')
        .then(inspect)
        .then(over(lensProp('modules'), filter(startsWith('./'))))
        .then(({ code, modules }) => ({
            code,
            files: union(modules.map(clearModule),
                [...resources, ...requiredFiles, ...infoFiles])
        }));
}
async function filterFiles(files) {
    const clearModule = replace(/^\.\//, '');
    const resources = files | filter(test(/^((icon\.png)|(README(\.\w+)?\.md))$/));
    const missing = without(files, requiredFiles);

    if (missing.length > 0) {
        return reject(Error(`missing ${missing.join(', ')} from the project`));
    }

    if (!contains('icon.png', files)) {
        emitWarning('compiling app without providing an icon.png file');
    }

    const infoFiles = await listFiles('info')
        | filter(test(/[a-z]{2}(_[A-Z]{2,3})?\.md/))
        | map(path.join('info/', _));

    return fs.readFileAsync('index.js', 'utf-8')
        .then(inspect)
        .then(over(lensProp('modules'), filter(startsWith('./'))))
        .then(({ code, modules }) => ({
            code,
            files: union(modules.map(clearModule),
                [...resources, ...requiredFiles, ...infoFiles])
        }));
}
async function filterFiles ( files ) { const clearModule = replace ( / ^\.\/ / , '' ) ; const resources = files | filter ( test ( / ^((icon\.png)|(README(\.\w+)?\.md))$ / ) ) ; const missing = without ( files , requiredFiles ) ; if ( missing . length > 0 ) { return reject ( Error ( ` ${ missing . join ( ', ' ) } ` ) ) ; } if ( ! contains ( 'icon.png' , files ) ) { emitWarning ( 'compiling app without providing an icon.png file' ) ; } const infoFiles = await listFiles ( 'info' ) | filter ( test ( / [a-z]{2}(_[A-Z]{2,3})?\.md / ) ) | map ( path . join ( 'info/' , _ ) ) ; return fs . readFileAsync ( 'index.js' , 'utf-8' ) . then ( inspect ) . then ( over ( lensProp ( 'modules' ) , filter ( startsWith ( './' ) ) ) ) . then ( ( { code , modules } ) => ( { code , files : union ( modules . map ( clearModule ) , [ ... resources , ... requiredFiles , ... infoFiles ] ) } ) ) ; }
Ensures there are missing no files in order to a allow a basic compilation
and filter the used modules. It also warns about possible improvements in the
apps

@param {String[]} files
@return {Promise}
Ensures there are missing no files in order to a allow a basic compilation and filter the used modules . It also warns about possible improvements in the apps