Skip to content
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

Shell config #26

Merged
merged 6 commits into from Apr 21, 2016

Conversation

Projects
None yet
3 participants
@Engil
Copy link
Owner

commented Apr 15, 2016

Hey everyone !
Following the discussions on #17, this PR introduce a few changes:

First, the style.sh has been removed and now everything happens inside config.ml thanks to a few advices from Drup on IRC.
This is really nicer, allowing to write a bit of logic without suffering from any shell language and adding assets configuration at the same level of the unikernel configuration.

Second, the JS libs are now retrieved using npm instead of bower.
package.json contains the various JS dependencies, and everything is bundled inside a single JS file using browserify. The main entrypoint is located inside assets/js/main.js, so if anyone want to add a random JS lib to their Canopy instance, they just need to add the dependency inside package.json, add the correct call in the JS entrypoint and everything should be alright. (and I will remove the --mathjax option in the process since adding random JS lib is now simpler)

One other thing is that now, if the user don't have lessc, browserify and npm inside the PATH, Canopy will decompress a tarball located in assets containing already fetched and compiled assets… I'm not really fond of this option, there is a need to allow user to not run npm and stuff on their machine to get started but I don't like the idea to keep this file under the repository by fear of it getting forgotten and not re-generated everytime something changes.

I think a got most of the changes of this branch covered here, so if you have any feedback, please don't hesitate. (I'm not sure if all the commands running in the new config.ml will work everywhere for example, it should work on Linux and OSX, not sure about FreeBSD… @hannesm ?)

ping @wiredsister @voila @dinosaure :)

(and also, this branch add highlight.js by default 🎉)

@wiredsister

This comment has been minimized.

Copy link

commented Apr 15, 2016

Awesome @Engil. Kudos. I'll respond more meaningfully after I play with it and see the changes.

Engil added some commits Apr 16, 2016

@Engil

This comment has been minimized.

Copy link
Owner Author

commented Apr 21, 2016

I think I will merge this to avoid keeping too many PR around, but if you have some feedbacks please don't hesitate. :)

@Engil Engil merged commit 6a606d5 into master Apr 21, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
(Printf.printf "npm, browserify and lessc not found… decompressing from assets/assets_generated.tar.gz\n";
run "tar -xf assets/assets_generated.tar.gz")

method clean i = Functoria_app.Cmd.run "rm -r node_modules disk"

This comment has been minimized.

Copy link
@hannesm

hannesm Apr 24, 2016

Collaborator

if node_modules and/or disk is not present, this leads to mirage clean failing... would be better to run the rm here only if the directories are present...

@hannesm

This comment has been minimized.

Copy link
Collaborator

commented Apr 24, 2016

crunch (which is called by generic_kv_ro since default kv_ro key is crunch) doesn't cope well with the 500KB JavaScript. I tried Archive and Fat as well without success (in a xen environment). Now I put the JS on another host, and edited canopy_templates with the url... this is not really optimal (but not really Canopy's fault, I suspect someone needs to walk through persistency in MirageOS (seems to be broken on various ends atm))

@hannesm hannesm deleted the shell-config branch Oct 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.