-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making the package importable [Meteor] #1
Comments
Hello @peterchoo! I think renaming everything to I also think, which IMHO is the obvious use case, the I'd say we might try to understand wheter from inside these files we could import something like
this is somehting like the path used to download the assets to the client side (lets check the path from where fonts are downloaded on the client). If this is the case, it might be quite easy to write a couple of templates for Otherwise, the wiser approach so far I can know about is the one used by @Nemo64 for his nemo64:bootstrap you can find on this repo Perhaps @Nemo64 would be willing to give us some help? :-) |
There are explicit locations for you to define your variables.
The same variable name may have different meaning in different contexts Please read the theming overview for more details. You can't import the files then define the variables after the fact, because the project uses variable scoping. |
@jlukic Thanks for the clarification, I wasn't aware of the variable scoping. With the restrictions outlines above, it doesn't sound like including a Semantic UI LESS package in the manner I adjusted it above will give you anything other than the default LESS compiled into a CSS file. I had a feeling the order in which files were processed was important. It seems to me that the best approach would be to do what @splendido suggested above, and look at @Nemo64 's approach, creating some custom middleware to compile the LESS files in a way which would on it's own provide the same output as the css available in the When I first looked into this, I was studying how @Nemo64 did it with the bootstrap stuff, it's an area I'm not too familiar with in Meteor, so any help provided for that would be very much appreciated. |
@peterchoo could you please make reference to the Meteor platform within the OP title? |
@splendido Your last comment has removed some blinkers for me, in that I'm no longer so sure that appending The best course of action now would be to write some middleware akin to @Nemo64's bootstrap - having looked more into it, this would take a sub-package containing the data, has a configuration file for the list of all files within the package, and then for all these files gets the content, and saves it to one output file, which the application's inclusion of the This sounds like an approach we can use, but it would need to be able to process the files in the way @jlukic outlined above. We would also need to figure out how we can include external sources. I'm wondering whether we can do this in one step, or whether the package can provide a set of files for a second build step? I have also been looking at the Meteor LESS package compile process and it takes advantage of Fibers/Futures. I haven't had any experience using them myself, but I would assume that we could use them here so that we only generate the compiled LESS file for the applications less package to compile for us. We could This would give us a package which would on it's own create a less file using only the defaults. If we get the compile process right, users could have a file in their project which acts as We could also provide a template package for adding custom themes, which would make all the theme files added available to the compile step. How exactly we go about the compile step I don't know. I think we will definitely have to use Futures, but with my inexperience I can't say how just yet. My gut feeling is that we can create an in memory file cache, and when all files of config type have been processed, we can then go through the build process for all the files in Your thoughts? |
The npm package includes a complete build script, I spent quite a bit of time working on it, and for me this is the preferred method of consuming the themable Semantic UI. You can read more about the original plan in this thread
I'm a bit unfamiliar with how I'm not sure how i'd go about rewriting those tools for every platform (Angular, Ember, Meteor) etc. |
Meteor itself has an automatic include process, i.e. if the less package is included in your application, every Inside a Meteor package, however, the Each time With all that said, the files are not exposed anywhere, and you cannot edit them. That's why in my comment above I suggest that once we find a middleware solution which would work, we have a sample package for applying a theme on top using that same middleware. |
Anyone willing to fork the readme and write a short explanatory note slash call for help? I'm a bit clueless on how to word it given my remedial knowledge of Meteor practices. https://github.com/Semantic-Org/Semantic-UI-LESS/blob/master/README.md |
Hi guys, And @flemay come out with a package inspired by the one proposed by @Nemo64 for Bootstrap. |
@splendido Thanks for pointing out! :) |
👍 |
@splendido out of curiosity what is missing from my package? :) |
@flemay, it's not the official one! ;-) ...all other SUI packages were officialy integrated by @jlukic under Semantic-Org and published on atmosphere under the We've reserved It might be that your package is just fine to be elected as the official one, but it should at least migrated under some official umbrella :-) |
@flemay The only concern is on automating updates to SUI. I think the best place to start, if you are comforable, is giving you an official semantic-org repo where you can move your files, and then giving you access to the atmosphere organization for semantic so that you can publish the package as After that we can discuss automating updates from the main repo. This just means updating our build script to push the You can take a peek at what we have currently here. This manages release of the |
@jlukic I am more than happy with the idea! :) I also have automated the process of getting version X of Semantic UI and generating the files into the packages. So part of my packages has been automatically generated. |
I've invited you to our team on Meteor 'semantic'. I think this is what we can do next
Thank you flemay for your hard work. If you need any help with autopublish talk to splendido, he's the one who made it. |
👍 |
Thanks you @jlukic! I will also need to create a new repo for the data and a new meteor package. |
@flemay, the repo already exists and is semantic-ui-meteor and the package name that will be used is |
The big part of the work, from what I can see, will be to create a grunt task to replicate the Once this will be ready the code you have inside your flemay:semantic-ui package should be migrated into semantic-ui-meteor. We'll then probably have to agree/confirm on the file names and folder structure to be used under the |
@splendido I have made a gulpfile to rename/etc the files. :) I think I don't understand how it would work without flemay:semantic-ui-data. Would you like to explain your thoughts? :) |
...perhaps I'm missing something, but wouldn't be enough to have the src files in the same package and use the very same code you have in |
If there was a way I would've taken this approach for sure unless I am not aware of it. From nemo bootstrap-data: "The reason this package exists is to provide a workaround for the limitation, that meteor does not allow static assets to be accessed in a build plugin. It is however allowed to 'use' other packages in a plugin and this other package can than provide static assets (which is what this package does)." |
So what's left to get this at |
I haven't moved the code yet. We need to create 2 repos and 2 packages. And how to integrate with autopublish. |
I've added a new repo that you can push to semantic-ui-meteor-data Once both repos are set up and to your liking I can turn on autopublishing. From what I understand it works off of GitHub tagged releases. I've given you access to the semantic org on Atmosphere as well. |
Thanks @jlukic I will push today/tomorrow! :) |
@jlukic @splendido Do you guys have preference about the package version number? Would you see semantic:ui v1.0.0 or semantic:ui v1.12.0? |
I think match the current version number Sent from my iPhone
|
yeah, defenitely the current SUI version to keep everything aligned! |
I just published semantic:ui and semantic:ui-data :) |
👍 |
what about the gulp tasks to update the two packages? |
@flemay, could you make |
@splendido would you mind to test without I haven't yet open sourced. I haven't had time to look at autopublish yet. |
If you find a way to do it without |
@flemay, I'll try to test it this evening (in about 12 hours...) |
@splendido Cool thanks! What I do understand about packages is even if a package requires |
well, there's a difference between having |
You are right! :) Just tested it and it worked! Thanks! |
@splendido I have updated github so if you could test locally (from the source) it would be very good and if you are happy we can then publish them on atmosphere! :) |
I've just cloned ...but nothing else is happening :( Am I missing something here? |
Maybe the README is not good enough. Basically, the package will not generate the files straight away. It allows you to select what you want first. You will need to modify the content of custom.semantic.json (it has to be different than .custom.semantic.json). |
I'd say a first default generaion would be more intuitive ;-) |
I removed a component and it worked! client/theme.import.less:15:1: Less compiler error: 'themes//default/globals/site.variables' wasn't found. Tried -
client/themes/default/globals/site.variables,/home/luca/Tests/test-sui/client/themes/default/globals/site.variables,themes/default/globals/site.variables |
would you like to open a feature request for generating the default by default? :) |
you mean a new issue on Semantic-UI-Meteor? |
yes. And regarding your issue, maybe you need to have a look at your |
btw thanks for testing! 👍 |
...for my bug I'll test to change the Tnx! |
Hi all,
I'm hoping to be able to use the LESS stuff in my application, and after a comment from @splendido on crater, I thought I'd have a quick look and see what I could get done.
Here is the initial set of changes I've made to the package to allow me to import it into a Meteor application.
The changes I made are fairly lightweight, but as far as I can see will not allow for external themes to be applied over the top, but it's a start! Here are the steps I took:
SemanticUI-LESS$ find . -type f -name "*.overrides" -exec mv "{}" "{}".import.less \;
SemanticUI-LESS$ find . -type f -name "*.variables" -exec mv "{}" "{}".import.less \;
themes/
tothemes
, andsite/
to_site
, andtheme.less
totheme.less.import.less
)theme.less to
theme.less.import.lessor
theme.import.less` (I used the former to follow the pattern I used on the overrides/variables files).import.less
on the files changed, and addtheme.config
to the addFiles array.If you're not familiar with the less processor in Meteor, it will ignore files ending
.import.less
.The package now processes all the remaining
.less
files in the order they are in the array provided toapi.addFiles()
. This order may need changing to match the build order if some parts of the LESS depend on others. My knowledge of LESS is rather shallow, and I've only really had a short look at the gulp build stuff.A brief experiment has shown that I cannot set something like
@button: 'amazon';
and have it affect the build process inside the package. My current plan is to find out if having theSemantic-UI-LESS
package include only the default theme, and reference the main repository for any theme examples. If that works (I can't see why not), then my next investigation will be into whether I can use and imply the main package in a theme package and add my LESS theme into that as a custom package... we shall see!Anyhow, this is the start I've made, let me know what you think etc :)
The text was updated successfully, but these errors were encountered: