<commit_before>var download = require('download')
var fs = require("fs")
var mkdirp = require("mkdirp")
var _ = require("underscore")
var endsWith = require('ends-with');
var files = [
    "http://localhost:7500/demos/react-todomvc-compiled/modules/todomvc-common/base.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/app.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/footer.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/todoItem.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/todoModel.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/app.js",
    "http://localhost:7500/demos/react-todomvc-compiled/modules/director/build/director.js",
    "http://localhost:7500/demos/react-todomvc-compiled/modules/classnames/index.js",
    "http://localhost:7500/demos/react-todomvc-compiled/modules/react/dist/react-with-addons.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/utils.js",
]

var sourceMapFiles = files.map(file => file + ".map")
var originalFiles = files.map(file => file + ".dontprocess")
files = files.concat(originalFiles)
files = files.concat(sourceMapFiles)

files.push("http://localhost:7500/fromjs-internals/from.js")
files.push("http://localhost:7500/fromjs-internals/resolveFrameWorker.js")
files.push("http://localhost:7500/fromjs-internals/inspector.js")

var OUT_DIR = "./gh-pages/react-todomvc2/"
files.push("http://localhost:7500/demos/react-todomvc-compiled/index.html")

files.push("http://localhost:7500/demos/react-todomvc-compiled/modules/todomvc-common/base.css")
files.push("http://localhost:7500/demos/react-todomvc-compiled/modules/todomvc-app-css/index.css")
files.push("http://localhost:7500/fromjs-internals/fromjs.css")

files.forEach(function(file){
    console.log("requesting", file)
    download(file).then(function(content){
        content = content.toString()
        var fileName = file.replace("http://localhost:7500/demos/react-todomvc-compiled/", "")
        fileName = fileName.replace("http://localhost:7500/", "") // for fromjs internals
        fileName = fileName.replace("http://localhost:7500/dist", "fromjs-internals")
        var parts = fileName.split("/")
        parts.pop()
        var dir = OUT_DIR + parts.join("/")
        console.log("create dir", dir)
        // console.log(file, "content", content.substr(0, 200))
        mkdirp(dir, function(){
            if (endsWith(fileName, ".html")){
                content = content.replace("/fromjs-internals/fromjs.css", "fromjs-internals/fromjs.css")
                content = content.replace('<script src="/fromjs-internals/from.js" charset="utf-8">',
                    '<script>window.fromJSInternalsRoot="fromjs-internals/"</script><script src="fromjs-internals/from.js" charset="utf-8">')
                content = content.replace('<script src="js/app.js"></script>', '<script src="js/app.js"></script>' + ` <script>
                  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

                  ga('create', 'UA-80477434-1', 'auto');
                  ga('send', 'pageview');
                </script>`)
            }
            fs.writeFileSync(OUT_DIR + fileName, content)
        })
    }).catch( function(){
        console.log("fail", arguments)
    })
})<commit_msg>Just overwrite react-todomvc<commit_after>var download = require('download')
var fs = require("fs")
var mkdirp = require("mkdirp")
var _ = require("underscore")
var endsWith = require('ends-with');
var files = [
    "http://localhost:7500/demos/react-todomvc-compiled/modules/todomvc-common/base.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/app.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/footer.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/todoItem.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/todoModel.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/app.js",
    "http://localhost:7500/demos/react-todomvc-compiled/modules/director/build/director.js",
    "http://localhost:7500/demos/react-todomvc-compiled/modules/classnames/index.js",
    "http://localhost:7500/demos/react-todomvc-compiled/modules/react/dist/react-with-addons.js",
    "http://localhost:7500/demos/react-todomvc-compiled/js/utils.js",
]

var sourceMapFiles = files.map(file => file + ".map")
var originalFiles = files.map(file => file + ".dontprocess")
files = files.concat(originalFiles)
files = files.concat(sourceMapFiles)

files.push("http://localhost:7500/fromjs-internals/from.js")
files.push("http://localhost:7500/fromjs-internals/resolveFrameWorker.js")
files.push("http://localhost:7500/fromjs-internals/inspector.js")

var OUT_DIR = "./gh-pages/react-todomvc/"
files.push("http://localhost:7500/demos/react-todomvc-compiled/index.html")

files.push("http://localhost:7500/demos/react-todomvc-compiled/modules/todomvc-common/base.css")
files.push("http://localhost:7500/demos/react-todomvc-compiled/modules/todomvc-app-css/index.css")
files.push("http://localhost:7500/fromjs-internals/fromjs.css")

files.forEach(function(file){
    console.log("requesting", file)
    download(file).then(function(content){
        content = content.toString()
        var fileName = file.replace("http://localhost:7500/demos/react-todomvc-compiled/", "")
        fileName = fileName.replace("http://localhost:7500/", "") // for fromjs internals
        fileName = fileName.replace("http://localhost:7500/dist", "fromjs-internals")
        var parts = fileName.split("/")
        parts.pop()
        var dir = OUT_DIR + parts.join("/")
        console.log("create dir", dir)
        // console.log(file, "content", content.substr(0, 200))
        mkdirp(dir, function(){
            if (endsWith(fileName, ".html")){
                content = content.replace("/fromjs-internals/fromjs.css", "fromjs-internals/fromjs.css")
                content = content.replace('<script src="/fromjs-internals/from.js" charset="utf-8">',
                    '<script>window.fromJSInternalsRoot="fromjs-internals/"</script><script src="fromjs-internals/from.js" charset="utf-8">')
                content = content.replace('<script src="js/app.js"></script>', '<script src="js/app.js"></script>' + ` <script>
                  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

                  ga('create', 'UA-80477434-1', 'auto');
                  ga('send', 'pageview');
                </script>`)
            }
            fs.writeFileSync(OUT_DIR + fileName, content)
        })
    }).catch( function(){
        console.log("fail", arguments)
    })
})

// /usr/local/bin/minify ./gh-pages/react-todomvc/fromjs-internals -d ./gh-pages/react-todomvc/fjsimin   
{'fraction_non_alphanumeric': 0.18961533233655023, 'fraction_numerical': 0.026777218975125732, 'mean_word_length': 3.4783931832014607, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6860129', 'n_tokens_mistral': 2632, 'n_tokens_neox': 2447, 'n_words': 248}