Commit 7f8fcb25 authored by Jérome Perrin's avatar Jérome Perrin

Theia 1.6.0

* syntax highlighting for git commit message and git rebase
* include a slapos logo
* Include some better monospace fonts (Source Code Pro and Jetbrains Mono)

See merge request nexedi/slapos!831
parents 5486ae80 ff5f9971
......@@ -64,6 +64,16 @@ environment =
url = https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.tar.bz2
md5sum = d0efec10b9f110a32e9b8f796e21782c
[source-code-pro-fonts]
<= fonts-base
url = https://codeload.github.com/adobe-fonts/source-code-pro/zip/235b72fc43a46cacf36e7c9b45d8d4fc0d121099
md5sum = b25e165c3fb984bbf6d847adfbd9d694
[jetbrains-mono-fonts]
<= fonts-base
url = https://download.jetbrains.com/fonts/JetBrainsMono-2.001.zip
md5sum = 62f02985bfef43a27dbdd17641fec210
# Microsoft's TrueType core fonts
# non-free so not enabled by default
[msttcore-fonts]
......
......@@ -15,12 +15,24 @@
[instance]
filename = instance.cfg.in
md5sum = f95354d4af4a78ad7fd11ebc9281ed19
md5sum = 397fcb3279029af3055b23525d147445
[yarn.lock]
filename = yarn.lock
md5sum = 07835b4acfbd8f4a96ac15ffecd238b0
md5sum = d058e73c3d90ac3da44734c2d47eac95
[python-language-server-requirements.txt]
filename = python-language-server-requirements.txt
md5sum = d2ce161244ce9ebce5295302a1b2a7df
md5sum = 0883a40ebcb33d8d7c520490b21bd16c
[preloadTemplate.html]
filename = preloadTemplate.html
md5sum = 8157c22134200bd862a07c6521ebf799
[slapos.css.in]
filename = slapos.css.in
md5sum = d2930ec3ef973b7908f0fa896033fd64
[logo.png]
filename = logo.png
md5sum = 97bd0f828ffbac2681af0f4bd72cba27
......@@ -54,7 +54,7 @@ template = inline:
root $${directory:frontend-static}
browse
proxy / $${theia-instance:base-url} {
except public $${favicon.ico:filename}
except $${frontend-instance-fonts:folder-name} $${frontend-instance-slapos.css:folder-name} public $${favicon.ico:filename} $${frontend-instance-logo:filename}
}
proxy /services $${theia-instance:base-url} {
websocket
......@@ -83,6 +83,33 @@ port = $${frontend-instance-config:port}
pidfile = $${directory:pidfiles}/$${:_buildout_section_name_}.pid
url = https://$${:hostname}:$${:port}/
[frontend-instance-fonts]
; XXX caddy 1 does not seem to serve different folders at different locations
; so we link fonts in static folder
recipe = plone.recipe.command
location = $${directory:frontend-static}/$${:folder-name}
folder-name = fonts
command =
mkdir $${:location}
ln -s ${source-code-pro-fonts:location} $${:location}/source-code-pro
ln -s ${jetbrains-mono-fonts:location} $${:location}/jetbrains-mono
stop-on-error = true
[frontend-instance-logo]
recipe = plone.recipe.command
filename = logo.png
command =
ln -s ${logo.png:output} $${directory:frontend-static}/$${:filename}
stop-on-error = true
[frontend-instance-slapos.css]
recipe = slapos.recipe.template:jinja2
template = ${slapos.css.in:output}
rendered = $${directory:frontend-static}/$${:folder-name}/slapos.css
folder-name = css
context =
key logo_image frontend-instance-logo:filename
[frontend-reload]
recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_}
......@@ -220,11 +247,14 @@ rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template = inline:
#!${python:location}/bin/python
import sys
import os
import sys
import time
args = sys.argv[1:]
# when running interactively, activate slapos configuration and reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555
if not args: args = ["-c", ". $${slapos-standalone-activate:rendered} && exec env GIT_EXEC_PATH= ${bash:location}/bin/bash", ]
# otherwise, assume this shell is running task and add an artificial delay to workaround https://github.com/eclipse-theia/theia/issues/2961
else: time.sleep(1)
os.execv('${bash:location}/bin/bash', ['${bash:location}/bin/bash'] + args)
[slapos-standalone-activate]
......@@ -323,3 +353,4 @@ project = $${:srv}/project
slapos = $${:srv}/slapos
frontend-static = $${:srv}/frontend-static
frontend-static-public = $${:frontend-static}/public
frontend-static-css = $${:frontend-static}/css
<script>
let link = document.createElement('link');
link.rel = "stylesheet";
link.href = "/css/slapos.css";
document.head.appendChild(link);
</script>
\ No newline at end of file
......@@ -14,7 +14,7 @@ parso==0.3.2
pluggy==0.8.1
pydocstyle==3.0.0
pyflakes==2.1.0
pygls==0.8.1
pygls==0.9.1
pylint==2.4.4
python-jsonrpc-server==0.1.2
-e git+https://github.com/palantir/python-language-server@50d03d5931d564e9908292ccfa21dd629ee817ba#egg=python_language_server
......@@ -26,5 +26,5 @@ typed-ast==1.4.1
typing-extensions==3.7.4.2
wrapt==1.11.2
yapf==0.29.0
zc.buildout.languageserver==0.2.1
theia-open==0.1.2
zc.buildout.languageserver==0.4.0
theia-open==0.3.0
This diff is collapsed.
......@@ -11,6 +11,7 @@ extends =
../../component/curl/buildout.cfg
../../component/coreutils/buildout.cfg
../../component/java-jdk/buildout.cfg
../../component/fonts/buildout.cfg
../../stack/slapos.cfg
../../stack/monitor/buildout.cfg
../../component/defaults.cfg
......@@ -116,6 +117,12 @@ eggs =
supervisor
setuptools
[template-base]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
[python-language-server]
version = 0.19.0
recipe = plone.recipe.command
......@@ -127,11 +134,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
stop-on-error = true
[python-language-server-requirements.txt]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
<= template-base
[theia]
recipe = plone.recipe.command
......@@ -152,10 +155,16 @@ uses = ${yarn.lock:recipe}
THEIA_DEFAULT_PLUGINS = ${:location}/plugins/
[yarn.lock]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
<= template-base
[preloadTemplate.html]
<= template-base
[slapos.css.in]
<= template-base
[logo.png]
<= template-base
[package.json]
recipe = slapos.recipe.template:jinja2
......@@ -193,6 +202,11 @@ template =
"java.home": "${java-jdk:location}"
}
}
},
"generator": {
"config": {
"preloadTemplate": "${preloadTemplate.html:output}"
}
}
},
"dependencies": {
......@@ -309,8 +323,11 @@ template =
"vscode-java-test": "https://github.com/microsoft/vscode-java-test/releases/download/0.22.0/vscjava.vscode-java-test-0.22.0.vsix",
"vscode-python": "https://github.com/microsoft/vscode-python/releases/download/2020.1.58038/ms-python-release.vsix",
"vscode-ruby": "https://github.com/rubyide/vscode-ruby/releases/download/v0.25.0/ruby-0.25.0.vsix",
"vscode-zc-buildout": "https://github.com/perrinjerome/vscode-zc-buildout/releases/download/v0.2.0/vscode-zc-buildout-0.2.0.vsix",
"plantuml": "https://open-vsx.org/api/jebbs/plantuml/2.13.12/file/jebbs.plantuml-2.13.12.vsix"
"vscode-zc-buildout": "https://github.com/perrinjerome/vscode-zc-buildout/releases/download/v0.4.0/vscode-zc-buildout-0.4.0.vsix",
"plantuml": "https://open-vsx.org/api/jebbs/plantuml/2.13.12/file/jebbs.plantuml-2.13.12.vsix",
"diff": "https://open-vsx.org/api/rafaelmaiolla/diff/0.0.1/file/rafaelmaiolla.diff-0.0.1.vsix",
"git-commit-syntax": "https://github.com/perrinjerome/git-commit-syntax/releases/download/v0.0.1/git-commit-syntax-0.0.1.vsix",
"git-rebase-syntax": "https://github.com/perrinjerome/git-rebase-syntax/releases/download/v0.0.1/git-rebase-syntax-0.0.1.vsix"
}
}
rendered = ${buildout:directory}/${:_buildout_section_name_}
......@@ -345,9 +362,7 @@ template =
[instance]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
mode = 0644
<= template-base
output = ${buildout:directory}/instance.cfg
[versions]
......
......@@ -32,6 +32,7 @@ import logging
import subprocess
import tempfile
import time
import re
from six.moves.urllib.parse import urlparse, urljoin
import pexpect
......@@ -81,6 +82,16 @@ class TestTheia(SlapOSInstanceTestCase):
self.assertEqual(requests.codes.ok, resp.status_code)
self.assertTrue(resp.raw)
# there is a CSS referencing fonts
css_text = requests.get(urljoin(authenticated_url, '/css/slapos.css'), verify=False).text
css_urls = re.findall(r'url\([\'"]+([^\)]+)[\'"]+\)', css_text)
self.assertTrue(css_urls)
# and fonts are served
for url in css_urls:
resp = requests.get(urljoin(authenticated_url, url), verify=False)
self.assertEqual(requests.codes.ok, resp.status_code)
self.assertTrue(resp.raw)
def test_theia_slapos(self):
# Make sure we can use the shell and the integrated slapos command
process = pexpect.spawnu(
......@@ -134,7 +145,7 @@ class TestTheia(SlapOSInstanceTestCase):
process.wait()
def test_theia_shell_execute_tasks(self):
# shell needs to understand -c "comamnd" arguments for theia tasks feature
# shell needs to understand -c "command" arguments for theia tasks feature
test_file = '{}/test file'.format(self.computer_partition_root_path)
subprocess.check_call([
'{}/bin/theia-shell'.format(self.computer_partition_root_path),
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment