The README of Generic Grocery Co.’s site has a fresh list of to-dos, and the first one, an “Open now” badge, needs a date library. That’s what moves the site to npm and Vite in this course, two tools that the front-end developer roadmap puts on the way to a first job. Before any of that, the site has to be on your computer, running, with its history intact.
In this lesson, you’ll get the starting code, either by extracting a ZIP or by updating the repository you already have, and check that the site runs and Git remembers every commit. Start with a quick look at what that history holds.
Look Back at the Site So Far
In the first course, the site arrived as a folder of HTML, CSS, and ES modules with three handmade copies of the deals file, and none of them said which one was live. It went under Git, and a week of to-dos turned into commits. If you took that course, then you know these habits. If you’re starting here, then they’re the ones you’ll follow for every change in this course:
- A
.gitignorebefore the first commit, sonotes.txtand its Wi-Fi password never went into the history git statusandgit diffbefore you stage, and one logical change per commit- A short, imperative subject line, with a body that says why
git logto find when something changed,git restoreto throw away an edit, andgit commit --amendto fix your last commit
The new starting point is that finished week plus one setup commit, “Plan the move to npm and Vite”. It updates three files:
README.mdgets the new to-do list, under Next: the move to npm and Vite.scripts/check.jsnow also reports on what the move will add, such aspackage.jsonand avitebranch.src/vendor/curbside.jsis new. It stands in for the pickup widget of Generic Curbside, the store’s ordering service.
Get the Starting Code
Both routes use the same download, the store’s site at the start of this course:
The ZIP contains a generic-grocery folder that includes a hidden .git folder, so the whole history comes along with the files. What you do with it depends on whether you want a fresh copy or want to keep the repository you’ve been working in.
Start From the ZIP
For a fresh copy, extract the ZIP wherever you keep your projects. Open the generic-grocery folder in VS Code with File → Open Folder…, then open a terminal with Terminal → New Terminal. The setup commit is already in this history, so you’re ready for the check below.
Keep Your Own Repository
If you already have your own generic-grocery repository with the week’s commits, then you can keep working in it and bring in only the setup commit’s files. Extract the ZIP somewhere other than your project, such as your Downloads folder, because the extracted folder has the same name as your project folder. Then, in a terminal in your own generic-grocery folder, copy the three files over:
$ cp ~/Downloads/generic-grocery/README.md .
$ cp ~/Downloads/generic-grocery/scripts/check.js scripts/
$ cp -r ~/Downloads/generic-grocery/src/vendor src/
These commands work in macOS and Linux terminals, in Git Bash, and in PowerShell. If you unzipped somewhere else, change the ~/Downloads part to match. Now ask Git what changed:
$ git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: README.md
modified: scripts/check.js
Untracked files:
(use "git add <file>..." to include in what will be committed)
src/vendor/
no changes added to commit (use "git add" and/or "git commit -a")
Before you stage anything, review what you’re about to record, as you do with every change. Start with a summary of the edits to tracked files:
$ git diff --stat
README.md | 15 +++
scripts/check.js | 275 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 287 insertions(+), 3 deletions(-)
The README gains the new to-do list and a row for the widget in its file table. Most of the new lines in scripts/check.js are checks for the move, such as the one for package.json. Run git diff to read both changes. Its output is long, so it opens in a pager: scroll with the arrow keys, and press Q to get back to your prompt.
Git doesn’t diff untracked files, so the widget isn’t in the diff. Open src/vendor/curbside.js in VS Code to read it instead. The comment at its top says it’s a stand-in that talks to no server.
Back in the git status output, src/vendor/ is listed under Untracked files, because Git has never seen it before. That’s why you stage all three files by name here, and not with git commit -am. The -a option only picks up files that Git already tracks, so it would leave the new widget out of your commit without a word:
$ git add README.md scripts/check.js src/vendor/curbside.js
$ git commit -m "Plan the move to npm and Vite"
[main f926686] Plan the move to npm and Vite
3 files changed, 368 insertions(+), 3 deletions(-)
create mode 100644 src/vendor/curbside.js
The line create mode 100644 src/vendor/curbside.js confirms that the new file made it in. Your hash will be different from f926686, because a commit’s hash depends on its author and time, and those are yours.
Check That Everything Works
Whichever route you took, you now check the same three things. First, the site itself. In this course, you preview it in VS Code’s integrated browser, which does the same job as Live Preview, without an extension to install. Right-click index.html in the Explorer and choose Open in Integrated Browser. The home page opens in a tab inside VS Code, and the page in that tab should look like this:

Below the heading, a line starting with Today: shows today’s opening hours, and under it are the weekly hours and every holiday’s hours. If you only see the placeholder Today’s hours, then the page’s JavaScript didn’t run. The most common cause is a page opened straight from disk instead of through the integrated browser.
Second, the history. Run git log --oneline and read it from the bottom up:
$ git log --oneline
09de33d (HEAD -> main) Plan the move to npm and Vite
b1e655b Close at 2 p.m. on Thanksgiving
1815f51 Fix the spelling of Produce on the departments page
69564a5 Add the bakery to the departments page
1d8c739 Start the deals for the week of November 25
de361ed Tick off the phone number to-do
1c4f029 Mark down the cranberries for the rest of the week
2124b2d Add .gitignore to the README's file table
632dbe3 Update the phone number in the footer
ad57ce5 Remove the hand-made copies of the deals
0aae397 Add the store's site as it arrived
The (HEAD -> main) part on the top line shows the branch you’re on, main, and the commit it points to. If the list ends in (END) instead of your prompt, then it opened in the pager, so press Q to get back. That’s the ZIP’s history. If you kept your own repository, your commits and hashes are your own, and the setup commit sits on top.
Third, the repository as a whole. Run the check script with node scripts/check.js, and its report should look like this:
Checking the Git repository in /Users/martin/projects/generic-grocery
✔ Git is installed (git version 2.43.0).
✔ The project folder is a Git repository.
✔ Your commits are labeled Martin Breuss <[email protected]>.
✔ .gitignore keeps notes.txt out of the repository.
✔ .gitignore keeps .DS_Store out of the repository.
✔ The history has 11 commit(s).
✔ npm is version 12 or later.
✔ You're on the main branch.
✔ No tracked file holds a Generic Curbside secret key (curb_sec_...).
✔ Everything is committed.
All checks passed.
Your report shows your own name, folder, and number of commits. A line marked ✘ or ! comes with a Next step, so follow it and run the script again.
If you’re unsure what a line means, then the button below opens a chat with the mentor and fills in a question. Paste your report after it, and the mentor goes through it with you:
With the site running and the check passing, you’re ready for the README’s new list. Its first to-do needs a package. Adding one changes how the whole project runs, and main holds the site that works today. In the next lesson, you’ll start the move on a branch of its own, so main keeps working the whole time.