Commit 346aee88 by Calen Pennington

Make django-pipeline only work with raw js and css

parent 9c7ba418
...@@ -35,7 +35,7 @@ MITX_FEATURES = { ...@@ -35,7 +35,7 @@ MITX_FEATURES = {
'AUTH_USE_MIT_CERTIFICATES': False, 'AUTH_USE_MIT_CERTIFICATES': False,
'STUB_VIDEO_FOR_TESTING': False, # do not display video when running automated acceptance tests 'STUB_VIDEO_FOR_TESTING': False, # do not display video when running automated acceptance tests
'STAFF_EMAIL': '', # email address for staff (eg to request course creation) 'STAFF_EMAIL': '', # email address for staff (eg to request course creation)
'STUDIO_NPS_SURVEY': True, 'STUDIO_NPS_SURVEY': True,
'SEGMENT_IO': True, 'SEGMENT_IO': True,
} }
ENABLE_JASMINE = False ENABLE_JASMINE = False
...@@ -195,20 +195,21 @@ from rooted_paths import rooted_glob, remove_root ...@@ -195,20 +195,21 @@ from rooted_paths import rooted_glob, remove_root
write_descriptor_styles(PROJECT_ROOT / "static/sass/descriptor", [RawDescriptor, ErrorDescriptor]) write_descriptor_styles(PROJECT_ROOT / "static/sass/descriptor", [RawDescriptor, ErrorDescriptor])
write_module_styles(PROJECT_ROOT / "static/sass/module", [RawDescriptor, ErrorDescriptor]) write_module_styles(PROJECT_ROOT / "static/sass/module", [RawDescriptor, ErrorDescriptor])
descriptor_js = remove_root( descriptor_js = [path.replace('.coffee', '.js') for path in remove_root(
PROJECT_ROOT / 'static', PROJECT_ROOT / 'static',
write_descriptor_js( write_descriptor_js(
PROJECT_ROOT / "static/coffee/descriptor", PROJECT_ROOT / "static/coffee/descriptor",
[RawDescriptor, ErrorDescriptor] [RawDescriptor, ErrorDescriptor]
) )
) )]
module_js = remove_root(
module_js = [path.replace('.coffee', '.js') for path in remove_root(
PROJECT_ROOT / 'static', PROJECT_ROOT / 'static',
write_module_js( write_module_js(
PROJECT_ROOT / "static/coffee/module", PROJECT_ROOT / "static/coffee/module",
[RawDescriptor, ErrorDescriptor] [RawDescriptor, ErrorDescriptor]
) )
) )]
PIPELINE_CSS = { PIPELINE_CSS = {
'base-style': { 'base-style': {
...@@ -216,19 +217,17 @@ PIPELINE_CSS = { ...@@ -216,19 +217,17 @@ PIPELINE_CSS = {
'js/vendor/CodeMirror/codemirror.css', 'js/vendor/CodeMirror/codemirror.css',
'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css', 'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css',
'css/vendor/jquery.qtip.min.css', 'css/vendor/jquery.qtip.min.css',
'sass/base-style.scss' 'sass/base-style.css'
], ],
'output_filename': 'css/cms-base-style.css', 'output_filename': 'css/cms-base-style.css',
}, },
} }
PIPELINE_ALWAYS_RECOMPILE = ['sass/base-style.scss']
PIPELINE_JS = { PIPELINE_JS = {
'main': { 'main': {
'source_filenames': sorted( 'source_filenames': sorted(
rooted_glob(COMMON_ROOT / 'static/', 'coffee/src/**/*.coffee') + rooted_glob(COMMON_ROOT / 'static/', 'coffee/src/**/*.js') +
rooted_glob(PROJECT_ROOT / 'static/', 'coffee/src/**/*.coffee') rooted_glob(PROJECT_ROOT / 'static/', 'coffee/src/**/*.js')
) + ['js/hesitate.js', 'js/base.js'], ) + ['js/hesitate.js', 'js/base.js'],
'output_filename': 'js/cms-application.js', 'output_filename': 'js/cms-application.js',
}, },
...@@ -237,18 +236,11 @@ PIPELINE_JS = { ...@@ -237,18 +236,11 @@ PIPELINE_JS = {
'output_filename': 'js/cms-modules.js', 'output_filename': 'js/cms-modules.js',
}, },
'spec': { 'spec': {
'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.coffee')), 'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.js')),
'output_filename': 'js/cms-spec.js' 'output_filename': 'js/cms-spec.js'
} }
} }
PIPELINE_COMPILERS = [
'pipeline.compilers.sass.SASSCompiler',
'pipeline.compilers.coffee.CoffeeScriptCompiler',
]
PIPELINE_SASS_ARGUMENTS = '-t compressed -r {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT)
PIPELINE_CSS_COMPRESSOR = None PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = None PIPELINE_JS_COMPRESSOR = None
...@@ -260,11 +252,6 @@ STATICFILES_IGNORE_PATTERNS = ( ...@@ -260,11 +252,6 @@ STATICFILES_IGNORE_PATTERNS = (
) )
PIPELINE_YUI_BINARY = 'yui-compressor' PIPELINE_YUI_BINARY = 'yui-compressor'
PIPELINE_SASS_BINARY = 'sass'
PIPELINE_COFFEE_SCRIPT_BINARY = 'coffee'
# Setting that will only affect the MITx version of django-pipeline until our changes are merged upstream
PIPELINE_COMPILE_INPLACE = True
############################ APPS ##################################### ############################ APPS #####################################
......
...@@ -27,7 +27,7 @@ PIPELINE_JS['js-test-source'] = { ...@@ -27,7 +27,7 @@ PIPELINE_JS['js-test-source'] = {
} }
PIPELINE_JS['spec'] = { PIPELINE_JS['spec'] = {
'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.coffee')), 'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.js')),
'output_filename': 'js/cms-spec.js' 'output_filename': 'js/cms-spec.js'
} }
......
...@@ -337,7 +337,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): ...@@ -337,7 +337,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
# cdodge: this is a list of metadata names which are 'system' metadata # cdodge: this is a list of metadata names which are 'system' metadata
# and should not be edited by an end-user # and should not be edited by an end-user
system_metadata_fields = ['data_dir', 'published_date', 'published_by', 'is_draft', system_metadata_fields = ['data_dir', 'published_date', 'published_by', 'is_draft',
'discussion_id', 'xml_attributes'] 'discussion_id', 'xml_attributes']
# A list of descriptor attributes that must be equal for the descriptors to # A list of descriptor attributes that must be equal for the descriptors to
......
...@@ -394,17 +394,18 @@ from xmodule.hidden_module import HiddenDescriptor ...@@ -394,17 +394,18 @@ from xmodule.hidden_module import HiddenDescriptor
from rooted_paths import rooted_glob, remove_root from rooted_paths import rooted_glob, remove_root
write_module_styles(PROJECT_ROOT / 'static/sass/module', [HiddenDescriptor]) write_module_styles(PROJECT_ROOT / 'static/sass/module', [HiddenDescriptor])
module_js = remove_root(
module_js = [path.replace('.coffee', '.js') for path in remove_root(
PROJECT_ROOT / 'static', PROJECT_ROOT / 'static',
write_module_js(PROJECT_ROOT / 'static/coffee/module', [HiddenDescriptor]) write_module_js(PROJECT_ROOT / 'static/coffee/module', [HiddenDescriptor])
) )]
courseware_js = ( courseware_js = (
[ [
'coffee/src/' + pth + '.coffee' 'coffee/src/' + pth + '.js'
for pth in ['courseware', 'histogram', 'navigation', 'time'] for pth in ['courseware', 'histogram', 'navigation', 'time']
] + ] +
sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/modules/**/*.coffee')) sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/modules/**/*.js'))
) )
# 'js/vendor/RequireJS.js' - Require JS wrapper. # 'js/vendor/RequireJS.js' - Require JS wrapper.
...@@ -420,13 +421,13 @@ main_vendor_js = [ ...@@ -420,13 +421,13 @@ main_vendor_js = [
'js/vendor/jquery.ba-bbq.min.js', 'js/vendor/jquery.ba-bbq.min.js',
] ]
discussion_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/discussion/**/*.coffee')) discussion_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/discussion/**/*.js'))
staff_grading_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/staff_grading/**/*.coffee')) staff_grading_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/staff_grading/**/*.js'))
open_ended_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/open_ended/**/*.coffee')) open_ended_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/open_ended/**/*.js'))
PIPELINE_CSS = { PIPELINE_CSS = {
'application': { 'application': {
'source_filenames': ['sass/application.scss'], 'source_filenames': ['sass/application.css'],
'output_filename': 'css/lms-application.css', 'output_filename': 'css/lms-application.css',
}, },
'course': { 'course': {
...@@ -435,24 +436,23 @@ PIPELINE_CSS = { ...@@ -435,24 +436,23 @@ PIPELINE_CSS = {
'css/vendor/jquery.treeview.css', 'css/vendor/jquery.treeview.css',
'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css', 'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css',
'css/vendor/jquery.qtip.min.css', 'css/vendor/jquery.qtip.min.css',
'sass/course.scss' 'sass/course.css'
], ],
'output_filename': 'css/lms-course.css', 'output_filename': 'css/lms-course.css',
}, },
'ie-fixes': { 'ie-fixes': {
'source_filenames': ['sass/ie.scss'], 'source_filenames': ['sass/ie.css'],
'output_filename': 'css/lms-ie.css', 'output_filename': 'css/lms-ie.css',
}, },
} }
PIPELINE_ALWAYS_RECOMPILE = ['sass/application.scss', 'sass/ie.scss', 'sass/course.scss']
PIPELINE_JS = { PIPELINE_JS = {
'application': { 'application': {
# Application will contain all paths not in courseware_only_js # Application will contain all paths not in courseware_only_js
'source_filenames': sorted( 'source_filenames': sorted(
set(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/**/*.coffee') + set(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/**/*.js') +
rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/**/*.coffee')) - rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/**/*.js')) -
set(courseware_js + discussion_js + staff_grading_js + open_ended_js) set(courseware_js + discussion_js + staff_grading_js + open_ended_js)
) + [ ) + [
'js/form.ext.js', 'js/form.ext.js',
...@@ -510,12 +510,6 @@ if os.path.isdir(DATA_DIR): ...@@ -510,12 +510,6 @@ if os.path.isdir(DATA_DIR):
os.system("rm %s" % (js_dir / new_filename)) os.system("rm %s" % (js_dir / new_filename))
os.system("coffee -c %s" % (js_dir / filename)) os.system("coffee -c %s" % (js_dir / filename))
PIPELINE_COMPILERS = [
'pipeline.compilers.sass.SASSCompiler',
'pipeline.compilers.coffee.CoffeeScriptCompiler',
]
PIPELINE_SASS_ARGUMENTS = '-t compressed -r {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT)
PIPELINE_CSS_COMPRESSOR = None PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = None PIPELINE_JS_COMPRESSOR = None
...@@ -526,8 +520,6 @@ STATICFILES_IGNORE_PATTERNS = ( ...@@ -526,8 +520,6 @@ STATICFILES_IGNORE_PATTERNS = (
) )
PIPELINE_YUI_BINARY = 'yui-compressor' PIPELINE_YUI_BINARY = 'yui-compressor'
PIPELINE_SASS_BINARY = 'sass'
PIPELINE_COFFEE_SCRIPT_BINARY = 'coffee'
# Setting that will only affect the MITx version of django-pipeline until our changes are merged upstream # Setting that will only affect the MITx version of django-pipeline until our changes are merged upstream
PIPELINE_COMPILE_INPLACE = True PIPELINE_COMPILE_INPLACE = True
......
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