intervalia / gulp-component-assembler Goto Github PK
View Code? Open in Web Editor NEWGulp plugin that assembles components including JavaScript, HTML Templates and Localization strings
License: MIT License
Gulp plugin that assembles components including JavaScript, HTML Templates and Localization strings
License: MIT License
It would be nice if prior to the inline content of a js file the bundler would assign a FILE variable, like so:
/*
/*
And so on... this would help when dealing with bundled js that uses AMD, for example.
Mike, do you really want to use a GPL 2 license? If you do, many companies won't use your software. That's why the open source community has gone largely to an MIT license.
I created a plugin that breaks early using return
. Then in all assemblies that caused the plugin to break early, the word undefined
was inserted into the assembly. Returning null should be the same as returning an empty string.
In an assembly, the getLang() function uses window.locale
to determine the current locale. Would it be possible to make where the locale is stored configurable?
If i understand it correctly assembler will provide produce single file as a final output. Is there a different workflow during development like using non assembled and non minified during unit testing and debugging in application in browser.
In my locale files, I've got the strings somewhat namespaced like this:
"heading": {
"additionalInfo": "Additional Information",
"alternateNames": "Alternate Names"
},
"label": {
"any": "Any",
"placeName": "Place Name",
"jurisdiction": "Jurisdiction"
},
"placeholder": {
"jurisdiction": "Search Jurisdictions",
"placeName": "Search Place Name"
},
"tooltip": {
"distanceHelp": "Specify 'k' for kilometers and 'm' for miles. e.g. '30m'"
},
"button": {
"advanced": "Advanced",
"backToResults": "Back to Results",
"clear": "Clear",
"search": "Search"
}
}
So in my template I would put {button.advanced}
, but it's not replaced in the template.
We need to be able to ignore all js, html templates, and sibling css files of assemblies from going though their normal processing pipelines. I'm currently using gulp-ignore and reading all the files from each assembly.json
to ignore js assets, but this doesn't give me the html template files or a css file.
Set root
option for glob calls to be process.cwd()
If you try to use gulp-sourcemaps
, you get the assembly.json
file instead of each individual JS file.
Watch for the files that are part of an assembly and rebuild the assembly on change, maybe using watchify.
Docs are currently lacking on how to get and use any of the plugins that are available in the plugins directory (need to require them using require('./node_modules/gulp-component-assembler/plugins/oldTemplates.js')
). If the require statement could be made shorter, or maybe just attaching the plugins to the component assembler, that would be nice too.
Last release was v2.1.1
If you set the watch
option to true, then running just the task to build assemblies will cause a watch to happen, which is an unexpected result. Instead, we should only trigger the watch inside a watch-like task so the user can control when the watch happens.
For example, if you gulpfile looks like
gulp.task('build', function() {
gulp.src('**/assembly.json')
.pipe(compasm.assemble({
watch: true
});
});
gulp.task('watch', function() {
gulp.watch('**/assembly.json', ['buld']);
});
gulp.task('default', ['build', 'watch']);
Running gulp build
will cause a watch, which is not what would be expected for just running the task itself. Also, running gulp watch
does not trigger the watch on the files of the assembly.
I'm not sure the best way to resolve this one myself. Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.