- Make sure you join the correct group
- Once you are part of that group, DO NOT create and
git init
a local directory. Alwaysgit clone
your teams' repo locally - If you prefer to name the directory you want to clone your project into,
mkdir
the directory and then, when you clone it, follow the command with a.
For example,git clone <url> .
This will copy the contents of the directory into the directory you named as opposed to making another folder - Add to your
.gitignore
.DS_Store
dist
node_modules
- Include your
package-lock.json
in your project, not your.gitignore
(I was wrong about this -Meg)
- Clone it to your machine
- Locate their
package.json
file and (in that directory) runnpm install
to install the packages needed to run their application - Locate their
Guntfile.js
and (in that directory) rungrunt
to bundle theirjs
files - After running grunt, locate their
dist
folder and within that folder, run yourhttp-server
- If they are using
json-server
locate their database and (in that directory) runcmd + r
and start to type injson-server
As you do that, your terminal will find the command in your prompt history. Alter the command to match the name of their database, and check the port their code is using to host the file (check their fetch statements)
Your file structure may look something like this. This is a general guideline it is not how it has to be done every single time.
── README.md
── api
|── database.json
── dist (made for you by grunt - do not edit these files)
|── bundle.js
|── bundle.min.js
|── index.html
|── styles
|── main.css
── src
|── index.html
|── lib
|── Gruntfile.js
|── package-lock.json
|── package.json
|── scripts
|── main.js
|── styles
|── main.css
|── .eslintrc
- If your file structure matches the one above, your
Gruntfile.js
will look something like the one below. - If you are using eslint, you may want a
.eslintrc
file like the one below
Some of the most useful jQuery shortcuts (vanilla first, jQuery second):
document.querySelector("#output")
$("#output")
let container = document.createElement("div")
let $container = $("div")
document.querySelector("#output").addEventListener("click", somefunction)
("#output").on("click", somefunction)
document.querySelector("#output").innerHTML = `I love ${programmingLanguage}!!`
("#output").text(`I love ${programmingLanguage}!!`)
//or, if you want to create elements via .html()
("#output").html(`<h1>I love ${programmingLanguage}!!</h1>`)