How to generate ccm.app.js?

Permalink 1 user found helpful
I'd like to suggest a few improvements to concrete5 (via github).
Those improvements involve changes to the concrete/js/ccm_app/ui.js file.
Anyway, this file is not directly used in web pages. Instead there some kind of optimization process that merges all the files in folder concrete/js/ccm_app into the file /concrete/js/ccm.app.js

So, here's the question: how can I re-create the /concrete/js/ccm.app.js starting from concrete/js/ccm_app/*.js files?

Thank you
Michele

mlocati
 
JohntheFish replied on at Permalink Reply
JohntheFish
+1. I ran across something yesterday where I asked myself just that question.
andrew replied on at Permalink Reply
andrew
I've created two shell scripts in a build/ directory in the root of the concrete5 github repository:

js.sh
css.sh

When run from the command line, these will automatically process and minify the .less files and place them where they need to be, and automatically concatenate and minify the the .js files and place them where they need to be. These build all the assets, including ccm.app.js, ccm.app.css, all other LESS files, bootstrap.js, etc...

Note: You must have uglify-js and lessc installed and in your $PATH for these to work.

Note: I'd like to place any i18n build tools in this build directory as well.
PulseTDI replied on at Permalink Reply
Is this why there is no build.sh file anymore? I am really annoyed that these got removed and there was no real documentation on what happened to these files and why they went away that I could find. I have customizations in the js files that become a part of the ccm.app.js when I run the build.sh script. I have wasted countless hours trying to get my js directory right for the sites that I took from concrete 5.5 to 5.6. There needs to be better documentation on this stuff.
mlocati replied on at Permalink Reply
mlocati
Well, they seems to be still there:
https://github.com/concrete5/concrete5/tree/master/build...

You may also want to try my php implementation: see
https://github.com/mlocati/concrete5-build...
PulseTDI replied on at Permalink Reply
Had issues installing uglify on CentOS so I chose to use YUI compressor. Also some of the ccm_app jquery file names were wrong and missing the underscore in front of them. Then had to add missing returns to concatenated ccm_app file because some files when spliced together had no space between the the end of the last line in one file and the start of the new line in the next file. That caused YUI compressor to fail. Then finally everything ran.

cat ./bootstrap/bootstrap.tooltip.js ./bootstrap/bootstrap.popover.js ./bootstrap/bootstrap.dropdown.js ./bootstrap/bootstrap.transitions.js ./bootstrap/bootstrap.alert.js > bootstrap.tmp.js
/usr/bin/java -jar /var/www/vhosts/yuicompressor-2.4.7.jar -o bootstrap.js ./bootstrap.tmp.js 
rm bootstrap.tmp.js
/usr/bin/java -jar /var/www/vhosts/yuicompressor-2.4.7.jar -o jquery.cookie.js ccm_app/jquery.cookie.js
# Note: The order here is important
cat ./ccm_app/_jquery.colorpicker.js ./ccm_app/_jquery.hoverIntent.js ./ccm_app/_jquery.liveupdate.js ./ccm_app/_jquery.metadata.js ./ccm_app/chosen.jquery.js ./ccm_app/dashboard.js ./ccm_app/filemanager.js ./ccm_app/jquery.cookie.js ./ccm_app/layouts.js ./ccm_app/legacy_dialog.js ./ccm_app/newsflow.js ./ccm_app/page_reindexing.js ./ccm_app/quicksilver.js ./ccm_app/remote_marketplace.js ./ccm_app/search.js ./ccm_app/sitemap.js ./ccm_app/status_bar.js ./ccm_app/tabs.js ./ccm_app/tinymce_integration.js ./ccm_app/ui.js ./ccm_app/toolbar.js ./ccm_app/themes.js > ccm.app.tmp.js
/usr/bin/java -jar /var/www/vhosts/yuicompressor-2.4.7.jar -o ccm.app.js ./ccm.app.tmp.js 
rm ccm.app.tmp.js