<commit_before># Front End Integrated Solution.

*Unfinished until version 1.0.0*

## Usage
    
    # install fis
    $ npm install -g fis
    
    # start local server
    $ fis server start
    
    # install service
    $ fis server install pc2
    
    $ mkdir project
    
    $ cd project
     
    # install a pc2-demo project
    $ fis install pc2-demo
     
    # release your project to local server
    $ fis release --watch
     
    # browse http://localhost:8080/photo


## commands

    Usage: fis <command>
    
    Commands:
    
      release     build and deploy your project
      server      launch a php-cgi server
    
    Options:
    
      -h, --help     output usage information
      -v, --version  output the version number

## fis release

    Usage: release [options]
    
    Options:
    
      -h, --help          output usage information
      -d, --dest <names>  release output destination
      -w, --watch         monitor the changes of project
      -c, --clean         clean cache before releasing
      --md5 <level>       md5 release option
      --domains           add domain
      --lint              with lint
      --optimize          with optimize
      --pack              with package
      --debug             debug mode

## fis server

    Usage: server <command> [options]
    
    Commands:
    
      start                  start server
      stop                   shutdown server
      restart                restart server
      info                   output server info
      open                   open document root directory
      install <name>         install server framework
    
    Options:
    
      -h, --help                     output usage information
      -p, --port <int>               server listen port
      --root <path>                  document root
      --script <name>                rewrite entry file name
      --timeout <seconds>            connection timeout
      --php_exec <path>              path to php-cgi executable file
      --php_exec_args <args>         php-cgi arguments
      --php_fcgi_children <int>      the number of php-cgi processes
      --php_fcgi_max_requests <int>  the max number of requests
      --no-rewrite                   disable rewrite feature

## fis-conf.js

### vim path/to/project/fis-conf.js

### settings

    fis.config.merge({          //merge user settings
        namespace : 'photo',    //using namespace, it can be omitted.
        roadmap : {             //configure directory and release specification.
            ext : {
                less : 'css'    //all the less files will be compiled into css files.
            },
            domain : {
                '*.js' : 'http://img.baidu.com'  //add domain to all js files.
            },
            path : [            //configure directory specification.
                {
                    reg : /^\/test\//i,     //all the files in "/test/" directory
                    release : false         //will not be released
                },
                {
                    reg : /^\/widget\/.*\.(js|css)$/i,  //all the js & css files in "/widget/" directory
                    isMod : true,                       //is modular file
                    release : '/static/${namespace}$&'  //release to "path/to/output/static/photo/..."
                },
                {
                    reg : /^\/widget\/(.*\.tpl)$/i,     //all the tpl files in "/widget/" directory
                    isMod : true,                       //is modular file
                    url : 'widget/${namespace}/$1',     //resource locator is "widget/photo/..."
                    release : '/template/widget/${namespace}/$1'    //release to "path/to/output/template/widget/photo/..."
                },
                {
                    reg : /^\/plugin\//i                //all the files in "/plugin/" directory will be released to "path/to/output/plugin/..."
                },
                {
                    reg : /^\/.+\.tpl$/i,                   //other tpl files
                    release : '/template/${namespace}$&'    //release to "path/to/output/template/photo/..."
                },
                {
                    reg : /^\/photo-map\.json$/i,           //photo-map.json
                    release : '/config$&'                   //release to "path/to/output/config/photo-map.json"
                },
                {
                    reg : /^.*$/,                           //any other files
                    release : '/static/${namespace}$&'      //release to "path/to/output/static/photo/..."
                }
            ]
        },
        deploy : {
            'rd-test' : {   //a deploy example
                receiver : 'http://zhangyunlong.fe.baidu.com/receiver.php',     //receiver
                to : '/home/zhangyunlong/public_html/'                          //post all the released files to the reciever, and save them to "/home/zhangyunlong/public_html/" directory of remote
            }
        },
        modules : {             //using plugins
            parser : {
                less : 'less'   //parse less file with "fis-parser-less" plugin (not built-in, install it with npm)
            }
        },
        settings : {                //plugin settings
            optimizer : {
                'uglify-js' : {     //configure uglify-js plugin, @see https://npmjs.org/package/uglify-js
                    booleans : true,
                    if_return : false,
                }
            }
        }
    });<commit_msg>readme修改<commit_after># Front End Integrated Solution.

*Unfinished until version 1.0.0*

## Quick start
    
    # install fis
    $ npm install -g fis
    
    # start local server
    $ fis server start
    
    # install service
    $ fis server install pc2
    
    $ mkdir project
    
    $ cd project
     
    # install a pc2-demo project
    $ fis install pc2-demo
     
    # release your project to local server
    $ fis release --watch
     
    # browse http://localhost:8080/photo


## Commands

    Usage: fis <command>
    
    Commands:
    
      release     build and deploy your project
      server      launch a php-cgi server
    
    Options:
    
      -h, --help     output usage information
      -v, --version  output the version number

    See:
        [fis-command-release](https://github.com/fouber/fis-command-release)
        [fis-command-server](https://github.com/fouber/fis-command-server)

## Configure fis

    # create fis config file
    $ vim path/to/project/fis-conf.js

```javascript
fis.config.merge({    //merge user settings
    //using namespace, it can be omitted.
    namespace : 'photo',
    //configure directory and release specification.
    roadmap : {
        ext : {
            //all the less files will be compiled into css files.
            less : 'css'
        },
        domain : {
            //add domain to all js files.
            '*.js' : 'http://img.baidu.com'
        },
        path : [    //configure directory specification.
            {
                //all the files in "/test/" directory
                reg : /^\/test\//i,
                //will not be released
                release : false
            },
            {
                //all the js & css files in "/widget/" directory
                reg : /^\/widget\/.*\.(js|css)$/i,
                //is modular file
                isMod : true,
                //release to "path/to/output/static/photo/..."
                release : '/static/${namespace}$&'
            },
            {
                //all the tpl files in "/widget/" directory
                reg : /^\/widget\/(.*\.tpl)$/i,
                //is modular file
                isMod : true,
                //resource locator is "widget/photo/..."
                url : 'widget/${namespace}/$1',
                //release to "path/to/output/template/widget/photo/..."
                release : '/template/widget/${namespace}/$1'
            },
            {
                //all the files in "/plugin/" directory
                //will be released to "path/to/output/plugin/..."
                reg : /^\/plugin\//i
            },
            {
                //other tpl files
                reg : /^\/.+\.tpl$/i,
                //release to "path/to/output/template/photo/..."
                release : '/template/${namespace}$&'
            },
            {
                //photo-map.json
                reg : /^\/photo-map\.json$/i,
                //release to "path/to/output/config/photo-map.json"
                release : '/config$&'
            },
            {
                //any other files
                reg : /^.*$/,
                //release to "path/to/output/static/photo/..."
                release : '/static/${namespace}$&'
            }
        ]
    },
    deploy : {
        'rd-test' : { //a deploy example
            //remote receiver
            receiver : 'http://zhangyunlong.fe.baidu.com/receiver.php',
            //post all the released files to the reciever
            //and save them to "/home/zhangyunlong/public_html/"
            to : '/home/zhangyunlong/public_html/'
        }
    },
    modules : { //using plugins
        parser : {
            //parse less file with "fis-parser-less" plugin
            //fis-parser-less is not built-in
            //install it by "npm install -g fis-parser-less"
            less : 'less'
        }
    },
    settings : { //plugin settings
        optimizer : {
            //configure uglify-js plugin
            //@see https://npmjs.org/package/uglify-js
            'uglify-js' : {
                booleans : true,
                if_return : false,
            }
        }
    }
});
```
{'fraction_non_alphanumeric': 0.11543184609087188, 'fraction_numerical': 0.002660663119115841, 'mean_word_length': 1.1144526179143228, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6140168', 'n_tokens_mistral': 2650, 'n_tokens_neox': 2512, 'n_words': 713}