I am setting up am Angular.js project from scratch. And I would like to keep it on Github inside a repository.
I have a simple question but I couldn't find a comprehensive answer for it. After establishing the project basic scaffold, and installing some node modules with NPM, there are many libraries, node-modules and etc in project structure. Also there are files of the framework for example Sails framework. Since a developer can install them by running npm install, which files should I push into the repository? Which ones don't need to be pushed?
The problem is, Source tree shows all new files as not staged, and I am confused which one I should exclude, which I should commit.
From personal experience, 2 types of files can be ignored in git
3rd party libraries, which can be installed using npm/bower etc.
Generated files, like css generated from less, minified js files, etc.
which files should I push into the repository?
Any files related to your application that contain business logic, routing, or other files that you've added to the project that are required for your app to run.
Which ones don't need to be pushed?
You should add node_modules to your .gitignore file. In almost all scenarios it would be unnecessary to include installed packages because your package.json maintains a list of packages to install when calling npm install.
If you're not sure about where to start with a .gitignore file, this is the defacto Node.js .gitignore file that is generated by GitHub & many popular IDE's. Just add that file to your project folder and git will automatically detect it, you should include your .gitignore as part of your repository files.
Additionally, if you're using Bower for front-end package management, you should add your bower.json to your repository and add the bower_components directory to your .gitignore.
Related
I have a simple WinForms app that I'm trying to package with MSIX. The app itself requires additional files that when I build the MSIX App Project doesn't copy/include.
Specifically this LIBVLC folder that gets included during the WinForms app build itself.
If I manually copy that folder over into the AppX build folder, everything works. Obviously I'm trying to automate including that folder.
Folder manually copied over in screenshot below:
How can I accomplish this? GitHub minimal repo:
https://github.com/aherrick/MSIXWinFormsLIBVLC
I suspect that this line is your issue : https://github.com/aherrick/MSIXWinFormsLIBVLC/blob/0e717828a16e796a7a27e415cf45d33a50327da9/MSIXWinFormsLIBVLC.AppPackage/MSIXWinFormsLIBVLC.AppPackage.wapproj#L80
The nuget package isn't really well understood by the build tools as those are native files that we collect "before build". It seems to cause issues when a project references a project that references the nuget package, and the usual workaround is to reference the nuget package directly in the topmost project.
Is it possible to reference a nuget package in a .wapproj ?
If it isn't, that's an issue for this repository https://code.videolan.org/videolan/libvlc-nuget/ . Contributions welcome
I'm creating a JS web app, and I know there are a lot of commands I use to set up my project: git init, npm init, etc. However, I also want to do two other things that sort of set up a barebones project for me: create-react-app and truffle init.
What exactly do each of these commands do, and what is the correct order I should run them in (truffle init I believe just creates some folders)?
I am mostly wondering if multiple package.json files are bad, or node_modules folders, or git files, since create-react-app seems to do some of things git init and npm init do. For one, I know create-react-app initiates a git repo. But I would like to put all react stuff in a "client" folder, and there are other things in the root of the directory. Is it bad to have nested git repos?
The short answer is: no, you shouldn't have multiple git files and node_modules folders and so on in your project (unless it's on purpose), simply because it makes it unclear which one your project should use.
git init creates a new git repository. You don't need to do this when using create-react-app and truffle init, because they already do it for you.
create-react-app creates a boilerplate for your project, and truffle is another boilerplate, so those shouldn't be used together. Pick one and stick with it.
When it comes to multiple git repos, there are different ways to do this depending on what you want. I suggest reading up on submodules, which is the intended way to have repos inside other repos. An alternative is to use a monorepo, which means using a single repo for multiple parts of the project, for example client and backend.
I'm having some projects in Eclipse, and two of them are angular apps. I've downloaded and installed some libraries using npm install, but now in Eclipse, I've got a lot of validation errors coming from the /examples and /test folders. I know it's possible to exclude these folders from Eclipse validation, but since none of the project team members use the examples or tests anyway, I'd like to remove them. But npm install retrieves them again.
How can I exclude these folders from the libraries?
I have a question, I want to use angular 2 in maven project, and as you now the modules should download with ( npm install or ng new .. (cli) ).
The problem is if I generate the war file with all this modules, it will be very large because of the presence of all the nodejs modules.
In one of Github example they install this modules with ( npm install ) and finally goes to the home directory and run spring-boot:run
I want directly deploy my war file, so my question is : i should generate the war file with the all the modules and dependencies of nodejs or there is another solution ?
Three ways:
add all node_modules dependencies in to your version control, so source is always there, or copy necessary js libraries manually in specific source folder, like angular.min.js and so on (if your node.js is not available on your server, by security reason)
create execution goal inside pom.xml, something like
How to deploy a node.js app with maven?
use https://github.com/eirslett/frontend-maven-plugin and check existing examples, I am sure your case is straight forward
I'm trying to upload my Yeoman Angular app to a git repo so that other developers can work on it. How do I go about it? Meaning, which files/folders should be uploaded and which can be skipped? I don't want the other developers to run the yo angular command, because it creates a new app with the folder name altogether. I tried copy pasting my folder contents to a new folder, excluded the node and bower modules, then ran npm install and bower install on this new folder. But now it fails to find phantomjs plugin. Is there a proper standard way to do what I'm trying to achieve?
Just pushed it as is. There is a .gitignore file which handles everything. The unwanted folders are automatically ignored.