Webstorm Projects and Node - What to Share and Why - javascript

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

Related

What is the difference between src, public, and build in folder structure?

I know what these files contain like build contains the minified file which is minified from src file. I need to know how browser works with it. I haven't uploaded my build file to hosting service yet my website got rendered. In the website, <script> SRC was linked to build but there was no build uploaded but a build was created automatically. this behaviour was observed in svelte. But I hope all framework does the same.
As far as I know, build tools like webpack, parcel, ...etc., use BUILD or DIST (Of course you can change it however you want) folder to store production ready build files of the project.
Files in PUBLIC are just copy & pasted to the build/dist folder when build process is finished. You can store index html, images, fonts, favicon or other static text files in there. They are not processed by build tools.
SRC folder is just for storing the whole project's unminified source code.
Most frameworks use 'build/dist - src - public' structure while frameworks like next.js uses root for storing project source code by default.
From the Vercel documentation found here https://vercel.com/docs/build-step "Vercel tries to automatically detect the frontend framework you’re using for your project and configure the project settings for you. If you’d like to override the settings or specify a different framework, you can do so from the Build & Development Settings section." So Vercel did automatically make a build folder for you. This is ok, because you should always use npm run build to create your build folder and point your hosting to use this folder for production.

Firefox add-on review with external libs

I would like to submit an add-on into FF AMO. My project includes some external libs and after uploading my xpi to the store I got the message that I need to fix the following issues to have the faster automated review and signing:
Markup should not be passed to innerHTML dynamically.
Access to the Function global
It finds this issues for example inside the following files:
data/Pages/bower_components/jquery/src/core.js
data/Pages/lib/underscore.js
What could I do to ignore files from review process?
Is there any options to do that?
Thanks in advance!
After a lot of work our automatic review was successful.
In this case with the third party libs the problems and the solutions were the followings:
Third party source codes installed with bower and stored in bower_components can be detected as third party libs and if they are in the FF review system already - like angular, jquery - they will be ignored. Everything is OK.
Using third-party libs added to the project in a custom way - copying a minified file into a custom named folder will be detected as own code and will be reviewed. Do not use them like that way. Install them with bower instead.
But as you could see it was problem with a bower installed file as well in the Question: data/Pages/bower_components/jquery/src/core.js. Before creating the xpi that you will upload it is recommended to clear (better in an automatized way e.g. with gulp) the bower_compontents as well from the source codes. Keep only the dist file or files of bower_components.

Cordova: How to change HTML source directory?

I am trying to use Cordova 3.4 in conjunction with AngularJS. I followed this tutorial and at some point it asks me to alter html.source.dir and html.asset.dir in ant.properties file. However, I am not being able to find this file anywhere in my source directory.
How do I change html source directory in Cordova?
Regards,
JadeSync.
turns out ant.properties do not come bundled with new versions of Cordova. I had to alter Gruntfile.js to change these directories.

How do I import the default Scripts folder into a blank mvc4 project

I created an empty MVC4 application. It doesn't contain the Scripts folder or any of the javascript files.
I need some of those js files.
How do I add them to my project? I can add a new folder, and download/add each JS file individually, but there has to be a better way. I know VS has them somewhere....
Example:
<script src="#Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
~/Scripts doesn't exist. Is there anyway that I can just import the folder with the default JS files?
Use NuGet. NuGet will correctly place JavaScript dependent frameworks into the ~\Scripts directory.
Right click on References->Manage NuGet Packages.
I used NuGet in my Project to pull down jQuery 1.9.1 as a dependency into my ASP.NET MVC4 Solution.
I verified that this brought in the following into my ~\Scripts directory:
jquery-1.9.1-intellisense.js
jquery-1.9.1.js
jquery-1.9.1.min.js
jquery-1.9.1.min.map
Here is my Solution Explorer:
This is a clean way to manage your default scripts (such as jQuery, knockout, or modernizr) via VS.NET and NuGet.
What I ended up doing was creating a new Internet application and just going into the project files and copying them over to the empty project.
There has to be a better way so leaving the question open for a while.
Create non empty project (it will contain all the scripts you need), then just copy them to your empty project into "Scripts" folder and take a look into few places how to include them into the project:
Global.asax
App_Start\BundleConfig.cs
That's all you need to do. Thanks & hope this helps!

Problems with adding multiple html files on Mosync

i'm new to Mosync and i'm trying to create an HTML5/Javascript project. The IDE generates a main.cpp file and an index.html file.
The main.cpp file contains a reference for the index.html file; i've already tried creating a new html file inside the same folder where the generated index.html file is and changed the reference in the main.cpp file to call the file that i've just created but it gives me an error that says the file cannot be found.
I've even tried removing all the code in the generate index.html file and running it and the results still shows all the deleted code from the index.html file.
My question would be how do i add multiple html files when creating a MoSync project?
It should work to do what you are doing, this could be a bug. Can you provide some details about which version of MoSync you are using, and which platform?
You should be able to have any html file in the folder LocalFiles in a MoSync project, and then just pass the file name to showPage in main.cpp, just as you are doing.
Perhaps the project is not rebuild properly? Try to right-click on the project in Eclipse, then select Rebuild. Are you on iOS or Android? How do you transfer the app to the device?
As Mikael mentioned also, I think it is an IDE bug, I tried refreshing/rebuilding the project and it worked fine. Sometimes eclipse does not detect file changes that come from other editors so it ignores them.

Categories

Resources