config.codekit reverts JS files with output/compilation unchecked - javascript

Codekit only allows you to disable compilation of JS files on a per-file basis, but what's worse is it consistently reverts JS files I've already marked as no "compilation/output".
It happens when you open a JS file to edit it, or when you switch Git branches. You don't notice the change, Codekit does a background "refresh", and automatically updates your config.codekit. Next thing you know, you're saving the file, and Codekit is compiling a JS file you don't want.
I can work around by reverting changes to config.codekit, but in a large JS app, this is at best a poor workaround, and sitewide disabling of JS compilation should be an option.

If anyone passes by this question and still needs help, I will give some answers I found which solved the problem for me.
First, you can edit file-processing settings project-wide. In the project settings, it is possible to apply an output parameter to all existing files with the "Apply" button:
Then, you have an option to pause file-watching with a simple shortcut that works across the whole system. It is useful to avoid unwanted changed made to CodeKit's config file when switching branch in Git.
You can find more details about it in the CodeKit online documentation:
Using CodeKit With Git or Subversion
Before you perform any action that will change large numbers of files at once (switching branches, rebasing, pull requests, etc.) you MUST tell CodeKit to ignore file changes.

Related

Visual Studio 2017 overwrote a file when I changed the filename, is there a way to revert that change?

I'm working on a project in visual studio, and I was switching between two instances of a file so I could showcase the differences between them. In order to switch between the files, I was being lazy and changing the filenames in file explorer outside of the IDE. It worked for a while, but unfortunately, this caused visual studio to overwrite one of the files with the other. I already checked the backup files, but my original file isn't there. Is there a way to undo this?
Thanks in advance.
EDIT
Ah, in case it isn't clear, the backup files I'm referring to are those located at MyDocuments\Visual Studio X\Backup Files\Project Name
There's no way to revert what happened. In order to minimize the danger of losing your work because of that I suggest to check out LocalHistory and use some form of source control for long term development history. Also, VS Code has a very nice option for comparing files that's definitely a must if you do that kind of things often.

How to alter a javascript extension and use it in my project without waiting for approvals?

I'm using an extension in my project called cytoscape in my Ember.js project and along with it, cytoscape-context-menushttps. I needed to make one tiny change to it to accommodate the needs of my project. I have done so and it works great (I tested it locally by simply monkey-patching the code in the relevant JS file in the extension and confirming it works).
I just want to know, how am I supposed to incorporate this change into my project, without having to manually change that bit of code every time we build our project? I know that I can pull down the repo and make a PR on it and get it approved, but that could take days/weeks/months. There must be a way I can manage this myself.
Fork the repository and use your own fork as the dependency. Maintain your fork and keep it up to date with the upstream repository. Switch back whenever your pull request is incorporated.

.Net Core and Typescript: how to instruct TFS to ignore generated js and js.map files

I have a .NET Core project and I want to use TypeScript. I would like to exclude the generated .js and .js.map files from my check-ins.
I have tried the tfignore approach described here, but this does not seem to work.
Any suggestion?
If it does not work then you likely already have the file under source control. You will need to remove the existing fine from source before the .ignore file will work.
If you delete the files from source control, check in, and get latest then you should not see them re-added to source control.
First, please make sure your .tfignore file created without any problem. This file does not have any suffix. One way to create it suggest you to rename a new.txt file with "tfignore." It will auto change to right .tfignore file.
You can also use the auto automatically generated .tfignore file, follow below steps:
In the Pending Changes page, in the Excluded Changes section, choose
the Detected changes link.
The Promote Candidate Changes dialog box appears.
Select a file, open its context menu, and choose Ignore this local
item, Ignore by extension, Ignore by file name, or Ignore by folder.
Choose OK or Cancel to close the Promote Candidate Changes dialog
box.
A .tfignore file appears in the Included Changes section of the
Pending Changes page. You can open this file and modify it to meet
your needs.
More info please check the Customize which files are ignored by version control from MSDN Link:Add files to the server
Second, just as MrHinsh said, it does not work when you already have the file under source control. You could try to create or generate some new js and js.map files for test. If the files already in source control you need to unbind/bind those files.
Another way to solve the issue is updating your VS to VS2015Update 3. The .tfignore should be indeed working correctly. More detail ways you can refer this blog from GitHub: Things in ".tfignore" still are shown in pending changes

Tern: Synchronizing script resources with tern server

In JBoss Devstudio, I am getting this new "error" with Tern: Synchronizing script resources with tern server. It's not really an error, but it's a process that occurs every single time I click in a JavaScript file. It's just spinning and freezes up the entire IDE. This has never happened to me before, and I was working on the project yesterday without any issues.
Does anyone know what the hell this is? There isn't really anything on Google except one post that says to upgrade.
JBoss Devstudio integrates tern.java for JavaScript support. I think your problem is because that you have a lot of JavaScript files in your project (inside node_modules or bower_components) and tern.java tries to analyze your all JavaScript files, and it takes time.
In your case, you need to exclude folders like node_modules and to do that you must use a version of tern.java >= 1.0.0 which support include/exclusion pattern path.
To deal with this problem, open your workspace and drop the folder, like E:\eclipse\workspace\.metadata\.plugins\tern.eclipse.ide.server.nodejs.embed.win32.win32.x86_64, the node.exe in it is the point.
I resolved this issue by simply eliminating the built in js files from path.
I removed this from validations '**/node_modules/*,**/bower_components/*'. (If it even didn't resolve)Go to Properties of the project > JavaScript > Include Path > Validation
OR
Go to Properties of the project > JavaScript > Include Path > Source and remove the whole project. Click on "Add Folder" and give the required path for your JS. Like projectname/src/pages.

Github Windows: Working with 'master' and 'gh-pages' branches

I've got a painfully simple jQuery plugin that I've written and placed on github. I am using Github for Windows and the website itself to manage the project.
Unfortunately, if I try to include any of the .js or .css files that I've uploaded there, through the Raw links, it fails in my browser due to the MIME-type being plain/text.
So, for the last couple of hours I've been researching how to get a copy of the files, through github, that people (including myself) can link to. The first step seems to be creating a project page (gh-pages branch)... that much I have grasped.
However, all of the material I've found so far either expects you to have a UNIX-based system, or do some console-based trickery:
Examples: GitHub, SO, SO
Now, there must be a straightforward way to simply make these source files available for inclusion. I went through the automated steps of creating a 'project page' and now I'm presented with another branch that is claiming to be behind the 'master' branch, but I can't see what I'm supposed to do next. It's not even clear to me why on earth I'm required to make another branch. This whole thing seems far more complicated than it needs to be.
So, to recap:
I've created a branch in Github (using Windows app and website)
I can manage that, and update my files, without incident
I am unable to include the .js and .css files using a 'raw' links
I want to be able to include those files in a page
I'd like to do this through Github for Windows, or on the site itself
If anyone could help walk me through this, I'd appreciate it. Also, I'd expect that A LOT of others would as well.
EDIT: Here is an example of a well-known Github project that has its files available through Github:
Select2:
http://ivaynberg.github.io/select2/select2-3.4.2/select2.js
EDIT2: Okay, conceptually, I now understand why I have to create a separate branch, in order to share the files - as the source control aspects of Github aren't meant to act as a CDN, the project page simply provides a public website where you can place your files. So the question now becomes: How do I put my files from the master branch into the gh-pages branch? I'm not worried about automating it or anything right now, all I want is access to the directory structure so I can place files in there. I've tried syncing and re-syncing my branch with Github Windows, but it tells me that there's nothing to get from the gh-pages branch, even though it's "10 commits behind". What is going on?
EDIT3: Added my own answer, for what I've come up with (so far).
As mentioned, there's lots of information out there for people who are using console-based Git software. However, I could not find a single piece of info on how to do this solely through Github Windows. Well, here is the solution:
Process:
Create a project page, as described here: https://help.github.com/articles/creating-pages-with-the-automatic-generator
Unfortunately, they only have console-based solution for getting a local copy. So here's how the rest of this works in Github Windows... (assumption: project name is myproject, consisting of myproject.js and myproject.css)
After the page has been created (takes a few minutes), open up Github Windows.
In Github Windows, open the repository for the project. On the top menubar it has "in sync", "master", "tools". Click on "master" and switch to "gh-pages" branch - SO example.
When you do this, the folder C:\Users\YourName\Documents\GitHub\myproject will now display the files for the "gh-pages" branch. If you click "master", in Github Windows, it will change the folder structure to once again represent the "master" branch. This is what confused me earlier, you can't see the directory structure for both branches at the same time.
Select the "master" branch in Github Windows.
In Windows Explorer, copy myproject.js and myproject.css into a separate directory (e.g., c:\temp).
Go back to Github Windows and select the "gh-pages" branch.
Go back to Windows Explorer and cut the files you put into c:\temp and paste them into a directory like C:\Users\YourName\Documents\GitHub\myproject\myproject-1.0\
Go back to Github Windows, and you'll see "2 files to be commited". Type in your commit message and click 'Commit'.
Then click 'Sync'.
You can now include these files in your webpages, using a URL like: http://yourname.github.io/myproject/myproject-1.0/myproject.js
Obviously this is a huge pain in the ass to do it this way, if you expect to be updating the source file(s) regularly. So obviously an automated approach would be most ideal. There is an answer for this on SO here, unfortunately it involves UNIX-based scripting which I have zero knowledge of (and, truthfully, no interest in learning just for this). If anyone comes up with a more efficient way of doing this, using only the GUI-based tools, I'm sure myself and many others would be interested in hearing about it.
EDIT: This solution is obviously usurping Github's intended way of doing things, as when I click on the "gh-pages" branch on the github website it tells me that it's "5 commits ahead and 11 commits behind" the master branch, even though they have the same files. So, again, if anyone else has a better GUI-based solution to this problem, I'm all ears.
Git(hub) software for Windows is the buggiest thing I've ever used (well, besides Windows itself). Back when I used Windows, I could hardly get anything to work with Git at all.
But, anyways, to answer your question, if you open a command prompt and type in
git checkout -b gh-pages
(if it complains about branch gh-pages already existing, remove the -b.)
it should switch the branch. Then, you can launch notepad++ or whatever text editor you use (you might have to do it from the terminal, I can't remember), add the file you want, and then type in (in cmd):
git add .
This recursively adds all files in the folder to Git.
git commit -m "Add file for easy user download"
This adds the commit message.
git remote add origin git#github.com:yourusername/yourrepository.git
This adds the Github repo so you can push to it
git push origin gh-pages
This pushes your changes to Github.
And, you're all set!
You might want to read this on Git branching.

Categories

Resources