Closed petschki closed 9 years ago
@petschki having sed/copy tasks in the pattern config would definetly be nice, regarding better encapsulation of functionality. that would need some change in mockup.core, so that a bower task scans all patterns in use (which are defined by requireJS) for some module.export (CommonJS via node) variables, which define the sed/copy tasks. i guess, that's kind of tricky. currently i cannot contribute to that, but any help would be nice.
by the way, another awesome addition would be a way to extend the requireJS config.js file instead of copying over for external mockup based packages.
however, this issue is solved, because i put all images and icons base64 encoded directly into the stylesheets via: https://github.com/collective/jquery.recurrenceinput.js/commit/0e328aed5f6470f5d7d3e6e280e84afce208886c
@thet in my latest mockup project i extend from plone-mockup config like this
(function() {
'use strict';
var extend = require('extend'),
requirejsOptions = require('./bower_components/plone-mockup/mockup/js/config'),
ploneMockupPrefix = 'bower_components/plone-mockup/mockup/',
requirejsOptionsExtend = {
paths: {
// additional
'bootstrap-tab': 'bower_components/bootstrap/js/tab',
'jquery-bridget': 'bower_components/jquery-bridget/jquery.bridget',
'imagesloaded': 'bower_components/imagesloaded/imagesloaded.pkgd.min',
'isotope': 'bower_components/isotope/dist/isotope.pkgd.min',
'jquery-cycle2': 'bower_components/jquery-cycle2/build/jquery.cycle2.min',
'jquery-cycle2-carousel': 'bower_components/jquery-cycle2/build/plugin/jquery.cycle2.carousel.min',
'jquery-cycle2-center': 'bower_components/jquery-cycle2/build/plugin/jquery.cycle2.center.min',
'jquery-cycle2-swipe': 'bower_components/jquery-cycle2/build/plugin/jquery.cycle2.swipe.min',
'jquery-infinite-scroll': 'bower_components/jquery-infinite-scroll/jquery.infinitescroll.min',
'jquery-prettyPhoto': 'bower_components/jquery-prettyPhoto/js/jquery.prettyPhoto',
'jquerytools': 'js/jquerytools.min',
'plone-overlayhelpers': 'js/overlayhelpers',
'plone-popupforms': 'js/popupforms',
'slick': 'bower_components/slick.js/slick/slick.min',
'pushy-menu': 'bower_components/pushy/js/pushy.min',
'query-string': 'bower_components/query-string/query-string',
'superfish': 'bower_components/superfish/dist/js/superfish.min',
'superfish-hoverintent': 'bower_components/superfish/dist/js/hoverIntent',
'mockup-bundles-unili': 'js/bundles/unili',
'unili-patterns-unili': 'js/patterns/unili',
'unili-ui': 'js/ui',
}
};
// fix paths for plone-mockup/mockup/js/config paths
for (var p in requirejsOptions['paths']) {
if(requirejsOptions['paths'][p].indexOf('bower_components/') == -1) {
requirejsOptions['paths'][p] = ploneMockupPrefix + requirejsOptions['paths'][p];
}
}
extend(true, requirejsOptions, requirejsOptionsExtend);
if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
module.exports = requirejsOptions;
}
if (typeof requirejs !== 'undefined' && requirejs.config) {
requirejs.config(requirejsOptions);
}
}());
this works nice, maybe you can tell me which documentation this belongs to, so I can update it...
OK, my latest post is completely off topic ... sorry for that
@petschki absolutely not! that's awesome! i have to try it out today.
regarding docs: here are some appropriate places: https://github.com/plone/mockup/blob/master/mockup/LEARN.md also: https://github.com/plone/mockup-training/blob/master/create_your_own.rst https://github.com/plone/mockup-training/blob/master/including_from_mockup.rst
all these docs need a bit of love... the training docs refer to mockup pre 2.0 from last year, so they might be outdated.
sed and copy tasks are missing in Gruntfile.js for *.png files in bower_components/jquery.recurrenceinput.js/src/
@thet your're mentioning here e1929d03ee0ead270405246f5366c5905462960f that sed/copy tasks should be defined by the pattern. this would be awesome! how can we get there?