How to update Bootstrap (and use LESS) in a Meteor app - meteor

I have followed the instructions given in the readmes of both bootstrap3-less and meteor-bootstrap-3 meteorite packages, but it seems there are steps missing.
Could someone explain, to an inexperienced developer, exactly (step-by-step) how to 'upgrade' from the Meteor package bootstrap to Bootstrap 3 (preferably with LESS but not essential)?
Some specific queries:
Should I uninstall the standard bootstrap package first?
Where does one reference the new .less or css files (or is that done as part of the mrt package)?
Any other best practises
Thanks.

It is almost just like you actually said. Assuming your are on linux/mac, make sure you are at project root directory and then
$ mrt remove bootstrap
$ mrt add less
$ mrt add bootstrap3-less
$ mkdir -p client/styles
$ touch client/styles/my-styles.less
$ sed -i '$ a\#import "/packages/bootstrap3-less/bootstrap.import.less";' client/styles/my-styles.less
$ cd public && ln -s ../packages/bootstrap3-less/lib/fonts ./
That's it. For further customization and advanced usage, take a look at the official readme at https://github.com/simison/bootstrap3-less
Also, search atmosphere for keyword bootstrap and you'll find lots of packages that you can include in your project.
Also, packages get updated from time to time.
Therefore, once in while, make sure you run in your project root directory:
$ mrt update
Or if you are cloning your project from git to a new workspace, you need to install third party packages first:
$ mrt install

Related

Reinstall Active Meteor Project

Background
I suddenly started getting a Meteor error:
~/.meteor/packages/meteor-tool/.1.4.0-1.1b1o7uq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/bin/darwin-x64-v8-4.5/fibers.node is missing. Try reinstalling node-fibers?`
After extensive searching, I came to the conclusion that there isn't a known, straight-forward solution to this problem.
Possible Solution
I created a new Meteor project and that works. This is because it is at the latest version of Meteor, and fibers.node is properly installed in the 1.6 (latest version) directory.
The best solution looks to be removing my live project directory and recreating it with the same name (at Meteor's latest version) and then retrieving all the packages, settings and files (HTML, JS, CSS)
Question
What is the best way to do this so that:
I preserve all the packages that I have installed (there are many)
I preserve all the custom settings that have changed from default
I am able to bring all my files (I am assuming this will be simple copy of *.html, *.css and *.js from the original project)
I was able to resolve the error:
~/.meteor/packages/meteor-tool/.1.4.0-1.1b1o7uq++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/bin/darwin-x64-v8-4.5/fibers.node is missing. Try reinstalling node-fibers?
so did not need to go down the reinstalling project path.
I followed the steps in the accepted answer on this thread:
How can I completely uninstall and then reinstall Meteor.js?
Specifically:
mv .meteor .meteor.bak
sudo rm /usr/local/bin/meteor
sudo chown -R $(whoami) ~/.npm/
curl https://install.meteor.com/ | sh
meteor --version -> This will pull the required package for the version your project is at.

How to install and open SpriteBuilder ?

I am from Hong Kong and I have some problems when I was trying to install SpriteBuilder. SpriteBuilder cannot be found in Hong Kong's App Store,so I need to install it from Github. With zero Github experience, I try to follow the instructions from the file, README.md , to install SpriteBuilder.
What do I need to do to open SpriteBuilder after input these code
git clone https://github.com/apportable/SpriteBuilder
cd SpriteBuilder
git submodule update --init --recursive
cd scripts
./build_distribution.py --version 1.x
and wait until it finish the install ?
Thanks a lot and I will be extremely grateful if anyone can help me to solve this problem.
As SpriteBuilder is no longer available at any store, there is a link to the last 1.4.9 installation:
https://www.dropbox.com/s/8kf5zfeg5haaeb1/SpriteBuilder-1.4.9.zip?dl=0
This is by far the best tool for 2d games development imo, even with 2 years without updates (or maybe is because that jeje)

How to remove npm files from meteor build

After upgrading Meteor to 1.3.x version NPM really came to play. But as always there is back side of the coin: build size.
On meteor 1.2.x build size is ~50MB, ~7k files
On meteor 1.3.x build size is ~190MB, ~27k files.
Twenty seven thousand files. That's quite a number. Not to mention path size exceeding 256 (a trouble for windows users).
I've dig into what meteor included into the build and it seems that all the npm_modules is here with all the stuff that is need to build some modules and their dependencies.
The question is: how to build meteor app without unnessesary npm files, leaving only the ones that are actually used by app at runtime?
Update:
On meteor 1.4.1_3 if you create a simple project meteor create dummy-project and go through all the common stuff like npm meteor install and meteor npm prune --production and them make a bundle out of it with meteor build c:\dummy --directory you will get a folder with the same 7k files and almost 2k folders (by the way it will not run node main.js out of the box as you might expect). If you tinker through folders you can find babel compiler inside that takes ~3.5k files.
Why do I need babel compiler inside compiled app?
To gain an introspective of your packages,
npm list --depth 0
to see the current packages in your project with only one level.
Inspect that list, and decide if you don't need a package and uninstall it.
You can also use other flags such as
npm list --depth 1 #the number represents the max depth
npm list --long true #for more information about the packages
npm list --global true #to check your global packages.
npm help-search <searchTerm>
Hope that helps you gain more insight in your packages. help-search Link
You may see that multiple packages depends on the same packages, and then it's up to you to decided what your application needs to run successfully.
Edit 1
You can exclude the packages inside your devDependencies, so that when you're publishing/deploying your code you have a cleaner package.
You do this by using npm prune --production - that removes all your devDependencies, and will require your users to do a npm install for your package to work. For info here

Node-csv-npm install causes Meteor to hang at "Starting your app..."

I created a new meteor app using meteor create, including bootstrap and coffeescript.
Then I added the following packages:
sudo npm install -g meteorite
mrt add filepicker
sudo mrt add xml2js
All is well at this point. I can start the app and see Hello World just fine.
Then I try to add the csv package:
sudo mrt add node-csv-npm
Install goes well, but when I go to start the app, in the terminal, it hangs at "Starting your app."
Open to any ideas.
Thanks!
This is not tied to the node-csv-npm package, I had the problem with another one that was working great an hour ago, but needed to be re-added due to branch merging. Unfortunately, the only solution I've found is a brutal one:
Remove all traces to the package from packages folder, smart.json, smart.lock and packages/.gitignore to be sure.
After that, manually add package/packagename folder with source of the package.

omega 4.x sub theme creation

I have spent lots of time to search good tutorial or documentation for creation omega 4.x sub theme, But did't found. Like How to create a layout templates using with node types, taxonomy, user pages. Any help appreciable
If you are a windows user, you will first need to set up a virtual box with linux. While linux is the preferred choice to theme with Omega 4, you can also use mac but will need homebrew, etc.
Windows user:
Virtualbox https://www.virtualbox.org/wiki/Downloads
Drupalpro https://drupal.org/project/drupalpro
Drupalpro is a prebuilt linux environment for drupal. Follow the directions for install then complete the drupalpro update that is documented in the middle of the page. Make sure and update drush as per the update directions as Omega 4 needs more recent version. Last, update ubuntu with sudo apt-get update (don't use the package manager)
The directions below have been tested with Drupalpro (source for rvm install)
Install https://rvm.io/ Always check for the most recent/stable version!
$ \curl -L https://get.rvm.io | bash -s stable
$ source /home/drupalpro/.rvm/scripts/rvm
$ rvm requirements
Next build and install the latest version of Ruby (this might take awhile). As of Aug 2013, this is the latest build. Please change as needed.
$ rvm install 1.9.3
$ rvm use 1.9.3
$ rvm rubygems latest
Verify rvm install:
$ rvm -h
$ rvm list
$ ruby -v
You should get a message similar to: ruby 1.9.3p448 (2013-06-27 revision 41675) [i686-linux]
Now you are set up and ready to install an Omega4 subtheme. Cd to the root of your drupal site.
drush dl omega --select
Choose the appropriate Omega4 version. This will automatically download and place Omega 4.x in sites/all/themes/omega. Omega4 comes with it's own drush commands which is why it is important to have a recent version of drush. Clear drush cache then view the new omega drush commands.
drush cc drush
drush help --filter=omega
Create your subtheme
drush omega-wizard
Follow the set-up directions.
Please enter the name of the new sub-theme [Omega Subtheme]: Yoursubthemename
Please enter a machine-readable name for your new theme [yoursubthememachinename]
Please choose a base theme for your new theme
2 : Omega - A powerful HTML5 base theme framework utilizing tools like
Sass, Compass, Grunt, Bower, Ruby Version Manager, Bundler and more.
Please choose a starterkit for your new theme
1 : Default: Comes with a well organized Sass setup with heavy use of
partials. (Provided by Omega)
Please choose a destination. This is where your sub-theme will be placed
Please choose a destination type.
1 : Site (e.g. 'all' or 'example.com')
Please choose a site.
1 : all
Do you want to keep the starterkit's readme files? (y/n):
Do you want to enable your new theme? (y/n):
Do you want to make your new theme the default theme? (y/n):
If everything went as it should you will see the following message:
You have successfully created the theme Yourthemename (yourthememachinename) in sites/all/themes. [success]
After finished, inside your subtheme run:
bundle install
trouble shooting If you receive an error at bundle install or at bundle exec guard, you may need to change your terminal preferences. terminal > profile preferences > title and command > check-mark "run command as login shell" image. Close terminal, cd back to the root of your site and run bundle install.
cd into root of sub-theme:
bundle exec guard
You have now created your Omega Subtheme. Documentation for creating custom layouts here
leveluptuts are making great tuts right now for omega 4.x
leveluptuts.com
here is the playlist at Youtube : http://www.youtube.com/playlist?list=PLLnpHn493BHH5nnK2dKE_42l1oXA6Tq6H with something like a new video per week !

Resources