##// END OF EJS Templates
front-end: Introduce 'front-end' directory with source files for building the front-end...
Mads Kiilerich -
r7379:19a9f024 default
parent child Browse files
Show More
@@ -8,7 +8,6 b' syntax: glob'
8 *.mo
8 *.mo
9 .eggs/
9 .eggs/
10 tarballcache/
10 tarballcache/
11 node_modules/
12
11
13 syntax: regexp
12 syntax: regexp
14 ^rcextensions
13 ^rcextensions
@@ -22,6 +21,8 b' syntax: regexp'
22 ^\.project$
21 ^\.project$
23 ^\.pydevproject$
22 ^\.pydevproject$
24 ^\.coverage$
23 ^\.coverage$
24 ^kallithea/front-end/node_modules$
25 ^kallithea/front-end/package-lock\.json$
25 ^kallithea/public/css/style\.css(\.map)?$
26 ^kallithea/public/css/style\.css(\.map)?$
26 ^kallithea/public/css/pygments.css$
27 ^kallithea/public/css/pygments.css$
27 ^theme\.less$
28 ^theme\.less$
@@ -12,12 +12,12 b' include development.ini'
12 include pytest.ini
12 include pytest.ini
13 include requirements.txt
13 include requirements.txt
14 include tox.ini
14 include tox.ini
15 include package.json
16 recursive-include docs *
15 recursive-include docs *
17 recursive-include init.d *
16 recursive-include init.d *
18 recursive-include kallithea/alembic *
17 recursive-include kallithea/alembic *
19 include kallithea/bin/ldap_sync.conf
18 include kallithea/bin/ldap_sync.conf
20 include kallithea/lib/paster_commands/template.ini.mako
19 include kallithea/lib/paster_commands/template.ini.mako
20 recursive-include kallithea/front-end *
21 recursive-include kallithea/i18n *
21 recursive-include kallithea/i18n *
22 recursive-include kallithea/public *
22 recursive-include kallithea/public *
23 recursive-include kallithea/templates *
23 recursive-include kallithea/templates *
@@ -35,22 +35,24 b' def front_end_build(install_deps, genera'
35 The installation of front-end dependencies happens via the tool 'npm' which
35 The installation of front-end dependencies happens via the tool 'npm' which
36 is expected to be installed already.
36 is expected to be installed already.
37 """
37 """
38 rootdir = os.path.dirname(os.path.dirname(os.path.abspath(kallithea.__file__)))
38 front_end_dir = os.path.abspath(os.path.join(kallithea.__file__, '..', 'front-end'))
39 public_dir = os.path.abspath(os.path.join(kallithea.__file__, '..', 'public'))
39
40
40 if install_deps:
41 if install_deps:
41 click.echo("Running 'npm install' to install front-end dependencies from package.json")
42 click.echo("Running 'npm install' to install front-end dependencies from package.json")
42 subprocess.check_call(['npm', 'install'], cwd=rootdir)
43 subprocess.check_call(['npm', 'install'], cwd=front_end_dir)
43
44
44 if generate:
45 if generate:
45 click.echo("Generating CSS")
46 click.echo("Generating CSS")
46 with open(os.path.join(rootdir, 'kallithea', 'public', 'css', 'pygments.css'), 'w') as f:
47 with open(os.path.join(public_dir, 'pygments.css'), 'w') as f:
47 subprocess.check_call(['pygmentize',
48 subprocess.check_call(['pygmentize',
48 '-S', 'default',
49 '-S', 'default',
49 '-f', 'html',
50 '-f', 'html',
50 '-a', '.code-highlight'],
51 '-a', '.code-highlight'],
51 stdout=f)
52 stdout=f)
52 lesscpath = os.path.join(rootdir, 'node_modules', '.bin', 'lessc')
53 lesscpath = os.path.join(front_end_dir, 'node_modules', '.bin', 'lessc')
53 lesspath = os.path.join(rootdir, 'kallithea', 'public', 'less', 'main.less')
54 lesspath = os.path.join(public_dir, 'less', 'main.less')
54 csspath = os.path.join(rootdir, 'kallithea', 'public', 'css', 'style.css')
55 csspath = os.path.join(public_dir, 'css', 'style.css')
55 subprocess.check_call([lesscpath, '--relative-urls', '--source-map',
56 subprocess.check_call([lesscpath, '--relative-urls', '--source-map',
56 '--source-map-less-inline', lesspath, csspath])
57 '--source-map-less-inline', lesspath, csspath],
58 cwd=front_end_dir)
1 NO CONTENT: file renamed from package.json to kallithea/front-end/package.json
NO CONTENT: file renamed from package.json to kallithea/front-end/package.json
General Comments 0
You need to be logged in to leave comments. Login now