Make django-pipeline only work with raw js and css
This commit is contained in:
@@ -35,7 +35,7 @@ MITX_FEATURES = {
|
||||
'AUTH_USE_MIT_CERTIFICATES': False,
|
||||
'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)
|
||||
'STUDIO_NPS_SURVEY': True,
|
||||
'STUDIO_NPS_SURVEY': True,
|
||||
'SEGMENT_IO': True,
|
||||
}
|
||||
ENABLE_JASMINE = False
|
||||
@@ -195,20 +195,21 @@ from rooted_paths import rooted_glob, remove_root
|
||||
write_descriptor_styles(PROJECT_ROOT / "static/sass/descriptor", [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',
|
||||
write_descriptor_js(
|
||||
PROJECT_ROOT / "static/coffee/descriptor",
|
||||
[RawDescriptor, ErrorDescriptor]
|
||||
)
|
||||
)
|
||||
module_js = remove_root(
|
||||
)]
|
||||
|
||||
module_js = [path.replace('.coffee', '.js') for path in remove_root(
|
||||
PROJECT_ROOT / 'static',
|
||||
write_module_js(
|
||||
PROJECT_ROOT / "static/coffee/module",
|
||||
[RawDescriptor, ErrorDescriptor]
|
||||
)
|
||||
)
|
||||
)]
|
||||
|
||||
PIPELINE_CSS = {
|
||||
'base-style': {
|
||||
@@ -216,19 +217,17 @@ PIPELINE_CSS = {
|
||||
'js/vendor/CodeMirror/codemirror.css',
|
||||
'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css',
|
||||
'css/vendor/jquery.qtip.min.css',
|
||||
'sass/base-style.scss'
|
||||
'sass/base-style.css'
|
||||
],
|
||||
'output_filename': 'css/cms-base-style.css',
|
||||
},
|
||||
}
|
||||
|
||||
PIPELINE_ALWAYS_RECOMPILE = ['sass/base-style.scss']
|
||||
|
||||
PIPELINE_JS = {
|
||||
'main': {
|
||||
'source_filenames': sorted(
|
||||
rooted_glob(COMMON_ROOT / 'static/', 'coffee/src/**/*.coffee') +
|
||||
rooted_glob(PROJECT_ROOT / 'static/', 'coffee/src/**/*.coffee')
|
||||
rooted_glob(COMMON_ROOT / 'static/', 'coffee/src/**/*.js') +
|
||||
rooted_glob(PROJECT_ROOT / 'static/', 'coffee/src/**/*.js')
|
||||
) + ['js/hesitate.js', 'js/base.js'],
|
||||
'output_filename': 'js/cms-application.js',
|
||||
},
|
||||
@@ -237,18 +236,11 @@ PIPELINE_JS = {
|
||||
'output_filename': 'js/cms-modules.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'
|
||||
}
|
||||
}
|
||||
|
||||
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_JS_COMPRESSOR = None
|
||||
|
||||
@@ -260,11 +252,6 @@ STATICFILES_IGNORE_PATTERNS = (
|
||||
)
|
||||
|
||||
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 #####################################
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ PIPELINE_JS['js-test-source'] = {
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
|
||||
# cdodge: this is a list of metadata names which are 'system' metadata
|
||||
# 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']
|
||||
|
||||
# A list of descriptor attributes that must be equal for the descriptors to
|
||||
|
||||
@@ -394,17 +394,18 @@ from xmodule.hidden_module import HiddenDescriptor
|
||||
from rooted_paths import rooted_glob, remove_root
|
||||
|
||||
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',
|
||||
write_module_js(PROJECT_ROOT / 'static/coffee/module', [HiddenDescriptor])
|
||||
)
|
||||
)]
|
||||
|
||||
courseware_js = (
|
||||
[
|
||||
'coffee/src/' + pth + '.coffee'
|
||||
'coffee/src/' + pth + '.js'
|
||||
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.
|
||||
@@ -420,13 +421,13 @@ main_vendor_js = [
|
||||
'js/vendor/jquery.ba-bbq.min.js',
|
||||
]
|
||||
|
||||
discussion_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/discussion/**/*.coffee'))
|
||||
staff_grading_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/staff_grading/**/*.coffee'))
|
||||
open_ended_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/open_ended/**/*.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/**/*.js'))
|
||||
open_ended_js = sorted(rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/open_ended/**/*.js'))
|
||||
|
||||
PIPELINE_CSS = {
|
||||
'application': {
|
||||
'source_filenames': ['sass/application.scss'],
|
||||
'source_filenames': ['sass/application.css'],
|
||||
'output_filename': 'css/lms-application.css',
|
||||
},
|
||||
'course': {
|
||||
@@ -435,24 +436,23 @@ PIPELINE_CSS = {
|
||||
'css/vendor/jquery.treeview.css',
|
||||
'css/vendor/ui-lightness/jquery-ui-1.8.22.custom.css',
|
||||
'css/vendor/jquery.qtip.min.css',
|
||||
'sass/course.scss'
|
||||
'sass/course.css'
|
||||
],
|
||||
'output_filename': 'css/lms-course.css',
|
||||
},
|
||||
'ie-fixes': {
|
||||
'source_filenames': ['sass/ie.scss'],
|
||||
'source_filenames': ['sass/ie.css'],
|
||||
'output_filename': 'css/lms-ie.css',
|
||||
},
|
||||
}
|
||||
|
||||
PIPELINE_ALWAYS_RECOMPILE = ['sass/application.scss', 'sass/ie.scss', 'sass/course.scss']
|
||||
PIPELINE_JS = {
|
||||
'application': {
|
||||
|
||||
# Application will contain all paths not in courseware_only_js
|
||||
'source_filenames': sorted(
|
||||
set(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/**/*.coffee') +
|
||||
rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/**/*.coffee')) -
|
||||
set(rooted_glob(COMMON_ROOT / 'static', 'coffee/src/**/*.js') +
|
||||
rooted_glob(PROJECT_ROOT / 'static', 'coffee/src/**/*.js')) -
|
||||
set(courseware_js + discussion_js + staff_grading_js + open_ended_js)
|
||||
) + [
|
||||
'js/form.ext.js',
|
||||
@@ -510,12 +510,6 @@ if os.path.isdir(DATA_DIR):
|
||||
os.system("rm %s" % (js_dir / new_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_JS_COMPRESSOR = None
|
||||
@@ -526,8 +520,6 @@ STATICFILES_IGNORE_PATTERNS = (
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user