Git Product home page Git Product logo

Comments (6)

chris-sev avatar chris-sev commented on July 29, 2024

Hello. gulp is installed globally, but if you are using it in projects that your co-workers will be building on also, a good way to define that dependency is to define it in the devDependencies section of your package.json. This way, everyone knows what dev tools are necessary and it will be installed on calling npm install.

https://www.npmjs.org/doc/files/package.json.html#devdependencies

Also, it technically doesn't matter if you run gulp from within scotch-box or from your local machine. The results will be pretty much the same since your local files are mirrored with the ones on the VM.

from scotch-box.

davidhund avatar davidhund commented on July 29, 2024

Of course. If we commit the node_modules we would not even have to npm install (although, generally I don't like adding node_modules to git).

But that does assume a co-worker would have npm and gulp etc. installed locally—if a she does not have npm/gulp installed locally—she would have to run npm install in the guest machine and run gulp from there. Conversely, running locally would require one to use e.g. the browser-sync --proxy, right?

I'm mentioning this because I need to write some simple instructions/documentation for a team of front-end developers and I am thinking of the most robust approach.

Also I do wonder if there could be changes between local gulp \ node or the one in scotch-box since, theoretically, versions could be different (also: different OSes)

Anyway, thanks for the quick reply.

from scotch-box.

chris-sev avatar chris-sev commented on July 29, 2024

The node_modules should be added to the .gitignore file. It's the accepted best practice since the versions are dictated by the package.json file so you wouldn't have version conflicts.

Instructions then would be:

  1. Install node and npm
  2. Install gulp globally: npm install -g gulp
  3. Clone the repository
  4. Install project dependencies: npm install
  5. Start the project by running gulp: gulp

I don't think you would need to use browser-sync --proxy. scotch-box uses shared folders so she wouldn't need to even ssh into it. You can run gulp locally and that would be much easier to provide instructions for than sshing into the VM.

from scotch-box.

davidhund avatar davidhund commented on July 29, 2024

@sevilayha Thanks Chris.

I am thinking about removing the need for 1) & 2) (which would probably require slightly different 4) & 5) :-) ). This way the Vagrant box would contain all the necessary tools.

PS: normally I would indeed add node_modules to the .gitignore.

Thanks for taking the time to reply, I think the common steps you describe should be manageable for most ;-)

from scotch-box.

chris-sev avatar chris-sev commented on July 29, 2024

Glad I could help. I can understand having all the encompassed tools within the box, but it is also important to note that it would be another good approach to have the project itself contain the necessary tools (by naming them and their versions in the package.json).

You never know if you will change up your environment in the future and it could break this current project. Having dependencies project based instead of box based gives you more flexibility moving into the future.

from scotch-box.

davidhund avatar davidhund commented on July 29, 2024

👍 🍻

from scotch-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.