Changeset - bf514091b27f
[Not reviewed]
default
92 5 0
Mads Kiilerich (mads) - 7 years ago 2018-12-10 23:32:39
mads@kiilerich.com
front-end: Use codemirror from node_modules and stop bundling it
97 files changed with 13 insertions and 30560 deletions:
0 comments (0 inline, 0 general)
.hgignore
Show inline comments
 
@@ -15,24 +15,25 @@ syntax: regexp
 
^dist/
 
^docs/build/
 
^docs/_build/
 
^data$
 
^sql_dumps/
 
^\.settings$
 
^\.project$
 
^\.pydevproject$
 
^\.coverage$
 
^kallithea/front-end/node_modules$
 
^kallithea/front-end/package-lock\.json$
 
^kallithea/front-end/tmp$
 
^kallithea/public/codemirror$
 
^kallithea/public/css/select2-spinner\.gif$
 
^kallithea/public/css/select2\.png$
 
^kallithea/public/css/select2x2\.png$
 
^kallithea/public/css/style\.css$
 
^kallithea/public/css/style\.css\.map$
 
^kallithea/public/js/bootstrap\.js$
 
^kallithea/public/js/dataTables\.bootstrap\.js$
 
^kallithea/public/js/jquery\.dataTables\.js$
 
^kallithea/public/js/jquery\.flot\.js$
 
^kallithea/public/js/jquery\.flot\.selection\.js$
 
^kallithea/public/js/jquery\.flot\.time\.js$
 
^kallithea/public/js/jquery\.min\.js$
LICENSE.md
Show inline comments
 
@@ -45,37 +45,37 @@ Copyright © 2011-2016 Twitter, Inc.
 

	
 
and licensed under the MIT-permissive license, which is
 
[included in this distribution](MIT-Permissive-License.txt).
 

	
 
It is not distributed with Kallithea, but will be downloaded
 
using the ''kallithea-cli front-end-build'' command.
 

	
 

	
 

	
 
Codemirror
 
----------
 

	
 
Kallithea incorporates parts of the Javascript system called
 
Kallithea uses the Javascript system called
 
[Codemirror](http://codemirror.net/), version 4.7.0, which is primarily:
 

	
 
Copyright &copy; 2013-2014 by Marijn Haverbeke <marijnh@gmail.com>
 

	
 
and licensed under the MIT-permissive license, which is
 
[included in this distribution](MIT-Permissive-License.txt).
 

	
 
Additional files from upstream Codemirror are copyrighted by various authors
 
and licensed under other permissive licenses.  The sub-directories under
 
[.../public/codemirror](kallithea/public/codemirror) include the copyright and
 
license notice and information as they appeared in Codemirror's upstream
 
release.
 
and licensed under other permissive licenses.
 

	
 
It is not distributed with Kallithea, but will be downloaded
 
using the ''kallithea-cli front-end-build'' command.
 

	
 

	
 

	
 
jQuery
 
------
 

	
 
Kallithea uses the Javascript system called
 
[jQuery](http://jquery.org/).
 

	
 
It is Copyright 2013 jQuery Foundation and other contributors http://jquery.com/ and is under an
 
[MIT-permissive license](MIT-Permissive-License.txt).
 

	
kallithea/bin/kallithea_cli_front_end.py
Show inline comments
 
@@ -73,24 +73,29 @@ def front_end_build(install_deps, genera
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'jquery.flot', 'jquery.flot.time.js'), os.path.join(public_dir, 'js', 'jquery.flot.time.js'))
 

	
 
        click.echo("Preparing DataTables JS")
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'datatables.net', 'js', 'jquery.dataTables.js'), os.path.join(public_dir, 'js', 'jquery.dataTables.js'))
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'datatables.net-bs', 'js', 'dataTables.bootstrap.js'), os.path.join(public_dir, 'js', 'dataTables.bootstrap.js'))
 

	
 
        click.echo("Preparing Select2 JS")
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2.js'), os.path.join(public_dir, 'js', 'select2.js'))
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2.png'), os.path.join(public_dir, 'css', 'select2.png'))
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2x2.png'), os.path.join(public_dir, 'css', 'select2x2.png'))
 
        shutil.copy(os.path.join(front_end_dir, 'node_modules', 'select2', 'select2-spinner.gif'), os.path.join(public_dir, 'css', 'select2-spinner.gif'))
 

	
 
        click.echo("Preparing CodeMirror JS")
 
        if os.path.isdir(os.path.join(public_dir, 'codemirror')):
 
            shutil.rmtree(os.path.join(public_dir, 'codemirror'))
 
        shutil.copytree(os.path.join(front_end_dir, 'node_modules', 'codemirror'), os.path.join(public_dir, 'codemirror'))
 

	
 
        click.echo("Generating LICENSES.txt")
 
        check_licensing_json_path = os.path.join(tmp_dir, 'licensing.json')
 
        licensing_txt_path = os.path.join(public_dir, 'LICENSES.txt')
 
        subprocess.check_call([
 
            os.path.join(front_end_dir, 'node_modules', '.bin', 'license-checker'),
 
            '--json',
 
            '--out', check_licensing_json_path,
 
            ], cwd=front_end_dir)
 
        with open(check_licensing_json_path) as jsonfile:
 
            rows = json.loads(jsonfile.read())
 
            with open(licensing_txt_path, 'w') as out:
 
                out.write("The Kallithea front-end was built using the following Node modules:\n\n")
kallithea/front-end/package.json
Show inline comments
 
{
 
  "name": "kallithea",
 
  "private": true,
 
  "dependencies": {
 
    "bootstrap": "3.3.7",
 
    "codemirror": "4.7",
 
    "datatables.net": "1.10.13",
 
    "datatables.net-bs": "1.10.13",
 
    "jquery": "1.12.3",
 
    "jquery.flot": "0.8.3",
 
    "select2": "3.5.1",
 
    "select2-bootstrap-css": "1.2.4"
 
  },
 
  "devDependencies": {
 
    "less": "~2.7",
 
    "less-plugin-clean-css": "~1.5",
 
    "license-checker": "24.1.0"
 
  }
kallithea/public/codemirror/LICENSE
Show inline comments
 
deleted file
kallithea/public/codemirror/lib/codemirror.css
Show inline comments
 
deleted file
kallithea/public/codemirror/lib/codemirror.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/apl/apl.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/asterisk/asterisk.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/clike/clike.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/clojure/clojure.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/cobol/cobol.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/coffeescript/coffeescript.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/commonlisp/commonlisp.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/css/css.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/css/less_test.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/css/scss_test.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/cypher/cypher.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/d/d.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/diff/diff.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/django/django.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/dtd/dtd.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/dylan/dylan.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/ecl/ecl.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/eiffel/eiffel.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/erlang/erlang.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/fortran/fortran.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/gas/gas.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/gfm/gfm.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/gherkin/gherkin.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/go/go.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/groovy/groovy.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/haml/haml.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/haskell/haskell.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/haxe/haxe.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/htmlembedded/htmlembedded.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/htmlmixed/htmlmixed.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/http/http.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/jade/jade.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/javascript/javascript.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/jinja2/jinja2.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/julia/julia.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/kotlin/kotlin.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/livescript/livescript.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/lua/lua.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/markdown/markdown.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/meta.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/mirc/mirc.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/mllike/mllike.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/modelica/modelica.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/nginx/nginx.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/ntriples/ntriples.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/octave/octave.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/pascal/pascal.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/pegjs/pegjs.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/perl/perl.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/php/php.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/pig/pig.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/properties/properties.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/puppet/puppet.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/python/python.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/q/q.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/r/r.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/rpm/rpm.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/rst/rst.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/ruby/ruby.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/rust/rust.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/sass/sass.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/scheme/scheme.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/shell/shell.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/sieve/sieve.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/slim/slim.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/smalltalk/smalltalk.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/smarty/smarty.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/smartymixed/smartymixed.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/solr/solr.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/sparql/sparql.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/sql/sql.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/stex/stex.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/tcl/tcl.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/textile/textile.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/tiddlywiki/tiddlywiki.css
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/tiddlywiki/tiddlywiki.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/tiki/tiki.css
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/tiki/tiki.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/toml/toml.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/tornado/tornado.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/turtle/turtle.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/vb/vb.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/vbscript/vbscript.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/velocity/velocity.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/verilog/verilog.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/xml/xml.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/xquery/xquery.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/yaml/yaml.js
Show inline comments
 
deleted file
kallithea/public/codemirror/mode/z80/z80.js
Show inline comments
 
deleted file
scripts/whitespacecleanup.sh
Show inline comments
 
#!/bin/bash -x
 

	
 
# Enforce some consistency in whitespace - just to avoid spurious whitespaces changes
 

	
 
files=`hg mani | egrep -v '/codemirror/|/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history|yui.2.9)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
 
files=`hg mani | egrep -v '/fontello/|/email_templates/|(/lockfiles.py|^LICENSE-MERGELY.html|^docs/Makefile|^scripts/whitespacecleanup.sh|/(graph|mergely|native.history|yui.2.9)\.js|/test_dump_html_mails.ref.html|\.png|\.gif|\.ico|\.pot|\.po|\.mo|\.tar\.gz|\.diff)$'`
 

	
 
sed -i "s/`printf '\r'`//g" $files
 
sed -i -e "s,`printf '\t'`,    ,g" $files
 
sed -i -e "s,  *$,,g" $files
 
sed -i -e 's,\([^ ]\)\\$,\1 \\,g' -e 's,\(["'"'"']["'"'"']["'"'"']\) \\$,\1\\,g' $files
 
# ensure one trailing newline - remove empty last line and make last line include trailing newline:
 
sed -i -e '$,${/^$/d}' -e '$a\' $files
 

	
 
sed -i -e 's,\([^ /]\){,\1 {,g' `hg loc '*.css'`
 
sed -i -e 's|^\([^ /].*,\)\([^ ]\)|\1 \2|g' `hg loc '*.css'`
 

	
 
hg mani | xargs chmod -x
0 comments (0 inline, 0 general)