-
Notifications
You must be signed in to change notification settings - Fork 33
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
Best way to publish for Meteor? #1
Comments
This very same discussion was somehow already started here Comparing all previous attempts made to publish style packages could be a good thing to start with ;-) |
@DerMambo originally proposed a semi-custom less import in his blog post Meteorjs and Twitter Bootstrap - The Right Way for which were created One problem with this approach at the moment is that the |
More recently @Nemo64 revised the customomization of less files import proposing claiming inspiration from this repository which goes back to the approach presented by @DerMambo @Nemo64 leverages a JSON file (which can be placed wherever inside your project) containing a list of boolean flags you can change to select which components to add. At a glance, this latter approach might seems a bit more hacky but still, IMHO, deserves some investigation. |
You'll see that what we're trying to do with this discussion could have larger borders... but perhaps I'm flying too much away ;-) |
I also see this repo in which we're discussing now is a separate repo. If it's only used to track Meteor integration issues & discussion - great. I think the actual integration code, when ready, should go along with the Semantic UI code, in that repo, under a So, in that
|
@zimme proposed with this post to have a base package containing all Adding this package to a project will be made available all source files to be possibly imported with a custom At the same time other dependant packages could automatically import only single components as well as the whole offer. Names for these dependant packages should be:
If this approach is fine for you all, we can start to setup things up and make the first tests to confirm its validity. |
Meanwhile, lets keep an eye also on this discussion started by @awatson1978. Any possible outcomes could be of interest also for this thread! |
A problem we'll be probably facing is understand which is the best way to get the icon fonts served... |
Hey @jlukic, may I ask which it the workflow you follow to publish a new release? I'm going to try to integrate the publication for Meteor directly from your Gulp file (in case you're using). ...obviously from our side, we'll do our best to get it working and tested so not to have you bother with this process. Let we know! Edit: it's the second time i switch gulp/grunt, sorry I was looking at an old fork I had among my repos. Now it seems you switched to gulp, right? |
I use https://github.com/Semantic-Org/Semantic-UI/blob/master/gulpfile.js#L640, I recommend creating a new task We can use the GitHub API also used extensively in |
Ok, thank you for the head up. Yeah, I'd try to leverage the github API to automatically setup everything for Meteor publish under Semantic-UI-Meteor (this repository)! For now I'd say it might be enough to get published one main package plus one for every component. |
I'm going to start playing with this on this forked repo. |
Be careful I can say from experience when doing git from command line, you might find that a mistake might ruin the commit history of many repos as once (for example committing merge conflicts), which can be a bit difficult to recover from. Have we decided whether meteor will include LESS files? How exactly will the files be changed for meteor? Will each JS definition have to be replaced? What needs to be adjusted for javascript to fit in more smoothly with meteor development? |
Be assured I'm not going to touch your repositories, only files under UI-Semantic-Meteor! I think LESS is the one agreed to be included. ...but probably a package with pure CSS will be faster to set up properly (basically simply picking up files and assets from the Anyone interested in publishing also |
for the less files, the only change would be the path for assets. For the JS I think there's nothing to change, even if I had a little weird experiences with it. |
I never changed the JS, only hardcoded CSS-paths to images or fonts. I learned the best way for using JS is to use callbacks. For example, Approve / Deny Callbacks for modals. Otherwise the function/position will be lost.. The |
About JS @kevohagan might have something to add about this ;-) |
Agree with @nooitaf, only thing I changed was paths. JS is working as supposed.
|
I'm a rather big fan of Nemo64's approach using the JSON configuration file (rather than using static links). Add the ability for in-app .less files to find the resulting output, and I'd be very, very happy as an application developer. As an app developer, I should be able to rename and refactor files with no hassle. Anything that breaks that is bad. Anything supporting it is good. |
I believe you misunderstood what I meant here. What i proposed was a "base" package named Then I proposed we have a separate, more "advanced" package named
The user of @import '/path/to/semantic:ui-less/definitions/reset.less';
@import 'path/to/semantic:ui-less/....';
...
... "use semantic-ui's mixins in their custom less code" ... |
Am with you up until the @imports. We need to figure out a way to get rid off those imports. Will probably require another package and build plugin though. |
Another rather crazy idea would be to make script that will add packages to meteor application based on .json file that contains list of desired components (true/false) values? |
semantic-ui have a gulpfile that can be used to build a custom version of semantic-ui.
If the user would like to change the custom semantic-ui components they would run And to use they would just |
Maybe the gulp script could use some file as input? |
Not sure about using input file for gulp. But with script based solution we could also handle |
Also, we could cover themes and site customization part. |
I'm working exactly on the gulp file to integrate the packages creation and publish. @zimme I think we're saying the same thing! The only thing I put different was that, once there's a
I'm also @awatson1978 about the need to have something to be used to influence packages configuration! From another point of view using the package Actually we could also publish pre cooked package whith this exactly pattern implemented, but already overwriting stuff based on available themes.
The only problem with this my proposed workflow? |
Definitions cant all be directly imported using less imports. They have to be compiled separately, see my comment here Semantic-Org/Semantic-UI#1294 (comment) LESS has really primitive variable scoping. My question for you guys is, if we're not translating/adjusting the source files for meteor, why do we need a different repos at all? Can't we just use the single component repos and the main repo and just publish to atmosphere? |
@jlukic from what I understand this repo is only for the work until we reach a decision on how to best publish semantic-ui to atmoshere and then it will work from the regular repo, hopfully automated with the gulpfile. =) |
Makes sense. 🎯 |
When it comes to the custom parts of semantic-ui I do believe a solution using the official build tools for semantic-ui would be great as there would be very little to no new documentation for the meteor part of semantic-ui. Also the build tools are only needed to select the theme/components/font-size and so on. When that's decided and compiled the user would rely on the compiled css/js. |
@jlukic the thing about publishing to Atmosphere is not so easy as you might be thinking of. What is needed is a This won't be in conflict with the already existing Having separate folders for each published package on this repo could permit to have specific README.md files (which will be linked from Atmosphere) containing information about how to install/use with Meteor, possibly a different title (ending with, e.g. I don't want to push towards this direction if you don't like it. I'm also happy to ear different proposals... What I'm doing now for the new gulp tasks is adding some more templates here (actually in a I'll let you know when I have something committed to take some comments from you folks! |
Readme files are generated in the Updating this for each repo is as simple as updating this template file |
Yeah, I'm on it... But so you're saying we could try to put all together? Thoughts? |
This PR seems to have now reached an agreement by the official maintainers. If you look at the changes proposed for the README.md you'll se a section about Meteor which links to a separate Is this something you'd accept to have? |
Yep, I'm perfectly fine with a |
Good! |
Ok, I did a simple test before proceeding too much on closed roads... This Package.describe({
name: 'semantic:ui',
summary: 'Semantic empowers designers and developers by creating a shared vocabulary for UI.',
version: '1.0.1',
git: 'git://github.com/Semantic-Org/Semantic-UI.git#1.0'
});
Package.onUse(function(api) {
api.versionsFrom('1.0');
api.addFiles([
'dist/semantic.css',
'dist/semantic.js',
'dist/themes/default/assets/fonts/icons.eot',
'dist/themes/default/assets/fonts/icons.otf',
'dist/themes/default/assets/fonts/icons.svg',
'dist/themes/default/assets/fonts/icons.ttf',
'dist/themes/default/assets/fonts/icons.woff',
'dist/themes/default/assets/images/flags.png',
], 'client');
}); put in the root folder of the Semantic-UI repo works just fine to serve the compiled css version. Summing up: to serve CSS versions (both whole and components) it is enough to inject some If we agree on names for these repos I'll go on with this as the first milestone. Note: the above files includes no testing for meteor! Getting packages with less files might be a bit more tedious ;-) |
with this commit I managed to add the The road to publishing css packages is narrowing ;-) |
Flag is, but icon isn't. I'll fix. https://github.com/Semantic-Org/UI-Icon/tree/master/assets/fonts |
Oh, sorry, I was looking at the components folder you create with the task The thing is I can't find where do you copy them from inside the |
Yeah, i copied them by hand since there are only 2 components that use them currently and its a bit simpler. |
Ok, up to know I've managed to create At the same time I've also added automatic copy of assets files into components' repo (obviously only required files and only for components needing assets...) There's also a bit of testing for the main repo, but only checking whether assets files are correctly shipped... I've also tested that linking repo folder as local package works fine! :-) You can have a look at the direction I'm taking looking at this comparison Let me know what do you think about this! |
This looks good splendido. The only thing I'm a bit worred about is hard coding individual component asset names in the build tools. This doesn't seem scalable for an (x) number component UI library. |
Yeah, I can imagine. The only thing is we need to list every single file used by a meteor package. For example this is the Package.describe({
name: 'semantic:ui-icon',
summary: 'Semantic UI - Icon, Single component release of icon',
version: '1.0.1',
git: 'git://github.com/Semantic-Org/UI-Icon.git',
//readme: 'git://github.com/Semantic-Org/UI-Icon/tree/master/meteor/README.md'
});
var where = 'client'; // Adds files only to the client
Package.onUse(function(api) {
api.versionsFrom('1.0');
api.addFiles([
'icon.css',
'assets/fonts/icons.eot',
'assets/fonts/icons.otf',
'assets/fonts/icons.svg',
'assets/fonts/icons.ttf',
'assets/fonts/icons.woff',
], where);
}); what would you suggest? whit that hardcoded list of assets I was also able to create all component repos from scratch also copying correct assets files. |
I'm going to repost this here to continue discussion in public venue These are transcribed from Splendido on Slack
I think managing assets manually is fine. Very few components use them and very few update them. I appreciate the draw in automation here, but I think it will add another point of failure.
The issue with LESS is that the files need to be compiled individually and cannot all be imported into a single file (that is compiled). Each ui element inherits (and modifies) values from some of the same files (like site.variables etc), and LESS doesn't know how to handle multiple inheritance, and insteads squishes it all into one global scope. This is all well and fine in the scope of a single UI element, but with multiple UI elements each inheriting overriding and inheriting again new defaults, its too much for LESS to handle. |
we previously said packages should be with less sources, but at the moment it seems a bit complicated to get direct integration for this. If we publish now css packages, should Also, would you mind installing Meteor (automatically) on your machine to run the publish script (still to be written...) you would you prefer someone else do this? curl https://install.meteor.com/ | sh and not all are happy with this... |
Hello @jlukic, The good news is I was working on a new project to facilitate 3rd party library integration into Meteor Packaging system. I think I'm going to prepare the final PR for the meteor integration by tomorrow. ...for the components' assets listing I'll revert to a normal file listing on the component's repo supposing all assets files are already there. In order to be able to complete all this, I still need an agreement on the final name to be used for publishing. The allowed form is:
for the organization part we have all these already reserved by @dandv:
for the package name we can do whatever we wish (special chars cannot be used, but the I'm for Btw, @jlukic after accepting the PR, all you'll have to do is head to http://autopublish.meteor.com/ and enable Semantic-UI and all component repositories for autopublish. Would you accept this? I really hope you'll like the idea and jump with us on this great project! |
Hei @jlukic, The text is quite general and does not make references to all the previous discussions we already had: this was purposely done to be later used as an example for other similar PRs. For now I'm supposing we're going to publish under the name Let me know if you're fine with all this, or if you wish to change something. Then we'll have to enable on autopublish.meteor.com also all components' repositories (in case you're still keeping them up to date: they're left back to version 1.4.1 at the moment...), but this will come later on (we need them to already contain a package.js file to be recognized as meteor packages...). Let we know! |
@splendido Can you confirm this is closed because it was fixed in Semantic-Org/Semantic-UI#1607? :) |
,,,woops sorry, I wanted to link to the current thread but I forgot to :( lets follow the continue of this discussion here Btw, at the moment all CSS packages are automatically published and are working good! |
As you might know Meteor supports as one of its core features CSS files discovery/minification/uglyfication.
At the same time thanks to an additional core package called
less
the support is seamlessly extended to LESS files.So we can say that CSS and LESS style files are both supported by default.
At this point we have one question to answer: what would be the best flavour to be used to publish the main
semantic:ui
package?Lets consider it is likely that other packages will be published to let any developer chose her preferred way to include styles.
could be other two secondary packages to be published to complete the offer.
We should also agree about the way to publish all packages whenever a new version of the UI will be released.
I strongly suggest to have an automated script that picks up the body text of the official new release (e.g. this) and then goes publishing package by package.
The approach @dandv is proposing seem like quite clever since it involves no source code duplication and paves the way also for automated testing.
Should we copy from him?
@jlukic, @lumatijev, @nooitaf, @dandv, your turn!
The text was updated successfully, but these errors were encountered: