How to deploy angulardart 5.2 properly for production? - dart

on the angulardart official website, I can not find any docs related to production deployment. I prefer command line way, so far I find out I can do webdev build to generate a build/ directory. But there are still some more questions:
I want to clarify what files I should deploy to the production server. I think they should be favicon.ico, index.html, main.dart.js, styles.css 4 files, right?
Why does it generate .build.manifest, .packages, packages/? two files and one directory which contains many directories and files. They are just confusing me. This is for production. Why do I ever want to have those files? Should I write a deploy script to simply auto-remove them?
It seems the generated main.dart.js is a minimized js file. But why are there many useless newlines in it? How to get rid of those useless newlines properly by using angulardart way? I can do that with gulp, but I don't want to use gulp if dart can handle this.
How to minimize html and css files properly by using angulardart way? for example, index.html and styles.css. Again, I can do that with gulp, but I don't want to use gulp if dart can handle this.
Thank you very much for your help.

Here you can find some of official doc :
https://webdev.dartlang.org/angular/guide/deployment

Related

How can I change the default path to the `rails` script in my project, or remove that dependency?

In another question (Why does the Rails command force a help message for the new command?), I found that Rails needs the rails script to be in the script folder, in the root of my project, in order for it to be properly detected as an existing Rails projects, and allow me to use the various rails commands other then new.
I did this because I felt that the more popular moniker for including executable content in a repository to highlight available use cases is by using the name scripts. At least the pluralism in English should be appreciated!
Is there anyway to change which folder the main Rails executable looks for the project-included one?
I actually think it's a bit silly to include this rails executable in the project, and can be redundant. Maybe it's for customization, but I feel that could better be done in the configuration, environment, other .rb files. So also, could this just be removed somehow, and still have a functioning project through varied use of the main rails command.

Importing Node Modules in to Rails

I'm working with Jasmine. I spotted this handy looking library: https://github.com/JamieMason/Jasmine-Matchers and I thought its collection of customer matchers would help me a lot.
Problem is, it's loaded with files common to Node applications, such as JSHint, Grunt, travis.yml etc
The project I'm working on, that would love these matchers, is a Rails application. I've tried dropping them into my assets/javascripts and requiring in application.js, but obviously, life isn't that simple.
What is the correct way to install these files, and integrate them with Jasmine in a Rails context? Is Bower the tool for the job? If so, what's the right procedure to adding JS dependencies/integrating them off the bat?
Author of Jasmine-Matchers here, the only file you need to load into your test environment is this one https://github.com/JamieMason/Jasmine-Matchers/blob/master/dist/jasmine-matchers.js.
The other files are part of the development repo, I'll open an issue to have those excluded from npm/bower packages to save confusion.
You should be able to copy that file to your assets/javascripts directory, then embed it after Jasmine but before your tests.
Please comment if I've missed anything out here.
I was also trying to use Node modules inside my Rails application and the easiest way I found to achieve it was through browserify-rails gem.
The installation is pretty straightforward, just follow the getting started section and everything should be working. :-)

Grunt and Rails

I'm working on using a Grunt workflow to manage my assets in my Rails app rather than Sprockets.
So far, I have my apps JS and CSS both being concatenated and minified into public/assets/javascripts/application.js and public/assets/stylesheets/application.css respectively.
And also have my Bower components JS and CSS being concatenated and minified into public/assets/javascripts/vendor.js and public/assets/stylesheets/vendor.css respectively.
Fonts and Images from Bower components are then copied into public/assets/(images|fonts).
This is all well and good but now I need the references to fonts/images within those files to be updated to reflect their new location.
I have looked at cssmin and yes it rewrites file references but I cannot get the file path to change depending upon the type of file being referenced.
Any ideas on how I can do this?
Also, I ahve been reading about Grunt plugins which can read your view files and use those to minify and concatenate files and update the and tags in the views for you.
Surely I can't do that in a Rails app? Is there a way I can deal with this in Rails?
This other StackOverflow post may be of help:
Integrate Grunt into Rails asset pipeline
The accepted answer recommends using the Half Pipe gem.
The second answer linked to a blog post about a Do-It Yourself solution: Goodbye, Sprockets! A Grunt-based Rails Asset Pipeline.
I haven't used either solution, but they are worth a try.

Using CodeKit 2 with Wordpress/Bootstrap via Bower

This may be a really dumb question but I've been searching the interwebs and haven't really found much helpful information. I have CodeKit 2 and I want to use Wordpress and Bootstrap in a project. I've never used Bower before but it looks really cool and I thought I'd give it a shot with CodeKit. I installed Wordpress, JQuery, and Bootstrap through the assets tab in my project and they installed into bower_components. In the video from Bryan Jones showing off Bower, he says not to move anything out of that folder or CodeKit won't see it as an asset anymore.
So my question is: how do I go about building my project from here? Obviously I don't want to have to run from the bower_components folder to do everything. In the Bower docs it says the easiest way is to just statically link the components you want. But I don't really understand how that would work with Wordpress and it seems like there'd be a better way to do it with CodeKit.
Thanks for the help!
There is no need to use Bower to manage wordpress, since wordpress can update itself very easily.
I think the best approach to building a WP site with Codekit is described in this tutorial: Use CodeKit 2.0 for Local WordPress Development.
Basically:
setup wordpress locally, any way you like, and use MAMP or AMPPS to serve the site.
drag your theme folder into Codekit - the theme is the project.
In the Browser Refreshing section of your project settings, use the external server option. Paste in the local URL for your new WP site.
Here's an article with some details.
Basically you just need to install bootstrap.less and variables.less in your /less folder, and then point your #import commands to your /bower_components folder. While you technically are running things out of /bower_components, after it's set up, you'll never know the difference.
The most useful thing about having wordpress connected to Bower is that you can just get the files downloaded quickly without having to grab the latest zip.
It makes sense to move the wordpress files to the top level, or where ever you are used to putting them.

using slimrb from command line

I am using slim for a project outside rails. I see that slimrb gives options to compile the templates to html from command line.
1) However is there a way to compile a complete view directory to html.
2) Also is it possible to watch for changes and, continuously update the generated html, like what compass does for .scss files.
There are actually two complete solutions to this problem! Both are quite easy to implement:
The Slim Guard plugin
Every Ruby developer should know about Guard. It's the easiest way to automatically transpile files.
There are actually two Slim guards on GitHub, and unfortunately the main one is older and not as good. I would recommend using indrekj/guard-sim (the one I linked to).
The RubyMine IDE by JetBrains
Truly exceptional software, RubyMine is heaven for Rubyists. It has built-in file watchers that you can configure on a per-project basis for transpiling all your typical assets. It's simple to set up a watcher for the Slim files using the slimrb program, and you're provided with a slew of customization options.
In RubyMine, you can import/export file watcher configurations; I host a few here, including one for Slim.
1) To compile all files in a directory from slim to html cd into it and type slimrb * and then hit tab to expand * into all filenames in that directory. Since it is a view directory there should be no other files then *.slim
2) Slim itself doesn't imlement this, but it shouldn't be too hard to write a script which listens for filesystem events and triggers based on which file was changed the slimrb executable.

Resources