Meteor - Accounts UI Template Get Reverts to Original Upon CSS Save - javascript

I am using the accounts-ui package and I have edited:
Meteor._def_template("_loginButtonsLoggedOutSingleLoginButton"
but every time I save my CSS this file regenerates and is overridden. Does anyone know why?

This is the hot code file editing feature. When you edit a file i think (not sure) meteor copies over the raw meteor files back into your project.
To get passed this you need to copy accounts-ui into a a directory called /packages in your project to override the default meteor package.

Related

Edit an existing cordova plugin

I want to change just a single line in an installed cordova plugin.
However, as the plugin is installed via package.json, any edit I do
on the source file does not get saved as the plugin is freshly
installed every time I make a new build of my app.
Is there some way to:
Copy-paste the whole plugin somewhere outside the plugins folder so I can edit without it getting overwritten.
Remove the plugin name from package.json and
Be able to reference the plugin inside my app so I can use the methods provided by the plugin.
Thank You.
You can clone the plugin and make the changes you want locally. Then you can add the plugin using corodova plugin add /path/to/plugin/folder.

Webstorm Projects and Node - What to Share and Why

I've got an idea folder in my Webstorm project. This is a node app. What do I need to share and why from this folder in source control? What settings should I share and why?
Also, how do I retain all my preferences from project to project? I find that if I create a new project (which I do by simply opening webstorm then opening the folder of code I just cloned down from a repo), I have to reset stuff like the JS version, and a bunch of other stuff in Preferences.
1) You just need to add the source folder to source control.
2) The easiest way to share Webstorm code style setting is using the .editorconfig plugin and adding the file to source control:
https://www.jetbrains.com/webstorm/help/configuring-code-style.html#d649738e184

How to edit a package with atmospherejs.com in meteor.js?

To install the package with the atmosphere in meteor.js sufficient to use a single command. But let us assume that there is a need to edit a specific package for themselves. Now I needed to translate into another language package accounts-ui-bootstrap. Package code is in the appropriate folder in the directory .meteor. Everything works as it should, but after restarting the application server, all changes are rolled back to its original state. What should I do?
Just add a new JS or CSS file on your public/server folder depends the case, and overwrite it

Dependency manager for Web

I have 2 projects. They use same js/img files. When I change js content in first project I should also change it in second project. I wanna make it as dependency. So I deploy changes to my local repository, then goto project1/project2, call update and changes are loaded.
I have tried to use bower but it doesn't satisfy me because of some strange behaviour (it copies whole folder content and ignores main section in component.json)
How can I implement normal dependency managment in my project? note: I need to manage my local dependencies
The main property in component.json is currently only used for other tools using Bower. There is currently a discussion going if Bower should have a .bowerignore file for ignoring files it doesn't need.
You might be better of just using a git submodule or symlinking the files.
Alternatively you could check out if any of the other JS package managers fills your need: npm, Ender, volo, component, jam
Another option (if you just want to fetch single files) might be: pulldown.
Configuration is extremely simple and you can easily add your own files/urls to the list.

Bundler for javascript, or how to source control external javascript files

I am in the process of converting an existing Rails 3.1 app I made for a client into a Backbone.js app with the Rails app only as a backend server extension. This is only a personal project of mine, to learn more about Backbone.js.
While setting up Backbone.js (using Backbone-on-Rails), I noticed I have some dependencies (like backbone-forms) that come from external sources and are frequently updated.
I've grown accustomed to using Bundler to manage my Ruby gems, but I haven't found anything similar for JavaScript files. I'm wondering if there is any way to do the same for Javascript (and possibly css) files.
Basically I can see three possibilities to solve this issue:
Simply write down all the sources for each JS file and check these sources from time to time to see what has changed.
Use some kind of existing "Bundler for Javascript" type of tool, I've been looking for something like this but have yet to find anything (good).
Since most of these JS files will be coming from Git anyway, use Git to get the files directly and use checkout to get the latest version from time to time.
I prefer the last option, but was hoping on some more input from other people who have gone this route or preferred some other way to tackle this issue (or is this even an issue?).
I figure the Git way seems easy, but I am not quite sure yet how I could make this work nicely with Rails 3.1 and Sprockets. I guess I'd try to checkout a single file using Git and have it be cloned in a directory that is accessible to Sprockets, but I haven't tried this yet.
Any thoughts?
You don't mention it in your alternatives, but ideally you should use something like Maven to manage your dependencies. Unfortunately, there are no public repositories for javascript files. This discussion lists some other options which might be of help to you: JQuery Availability on Maven Repositories
For now I've settled on using the Git solution combined with some guard-shell magic.
The steps I follow:
Create a dependencies directory somewhere on your local drive
Clone the repositories with javascript (or css) files you want to use in the app
Set up a custom guard-shell command to do the following:
group 'dependencies' do
guard 'shell' do
dependencies = '~/path/to/dependencies/'
watch(%r{backbone-forms/src/(backbone\-forms\.js)}) {|m| `cp #{dependencies + m[0]} vendor/assets/javascripts/#{m[1]}` }
end
end
Place the Guardfile at the root of the app directory
It takes some time to set things up, but after that, when you have the Guard running, and you pull changes into your dependencies, the required files are automatically copied to your application directory, which are then part of your repository.
It seems to work great, you need to do some work for each new file you want to include in the asset pipeline, but all that is required is cloning the repository in your dependencies directory and adding a single line to your Guardfile, for example for the backbone-form css:
watch(%r{backbone-forms/src/(backbone\-forms\.css)}) {|m| `cp #{dependencies + m[0]} vendor/assets/stylesheets/#{m[1]}` }
Also, the reason I added this Guard to a group is because I keep my dependencies outside the main application directory, which means guard normally doesn't check my dependencies directory. To make this work, I start up my main Guard processes using bundle exec guard -g main and use bundle exec guard -w ~/path/to/dependencies -g dependencies in a new terminal window/tab to specify the -w(atchdir).

Categories

Resources