Before you start working with Node.js, you need a text editor to write your code. Visual Studio Code (VSCode) is a popular choice due to its rich set of features and extensions that can enhance your productivity. However, you can use any text editor you are comfortable with, as long as it does not impose the complexities of a full Integrated Development Environment (IDE).
Git is a distributed version control system that allows multiple developers to work on the same project without interfering with each other's work. It tracks changes, allows you to revert to previous states, and supports multiple workflows for collaboration. Using Git ensures that you can manage your project's code base efficiently, handle merge conflicts, and maintain a history of your project's progress.
6. Clone the Github Repo
3
Clone the Starter Github Repo to your local repository:
Create a new empty folder named ldf-website and open vscode in it.
Keyboard Shortcut
You can open a new terminal using : Ctrl + Shift + `
Run the git clone command
npm
The . means to clone the content of the repository into the current directory.
You should be able to see some files now
7. Installing the packages
2
Using the Node Package Manager
You can install the packages using a node package manager. node has these few package managers:
NPM (comes by default, slowest, popular)
YARN (faster than npm)
PNPM (fastest)
Fast Package Manager
I like to work with pnpm but you can use any of the above package managers. if you want to install a package manager you can do so using NPM
for example you can install PNPM
npminstall-gpnpm
Installing the Packages defined in the package.json File
pnpm i
# or
pnpminstall
replace pnpm with npm or yarn if you want to use some other package manager.
Allow Remote Execution Of Scripts On Powershell
if you are using pnpm on powershell for the first time, you may encounter an issue like this:
Running Scripts is disabled on this system
To fix this, open PowerShell in administrator mode and run:
Set-ExecutionPolicy RemoteSigned
8. Starting the development Server
2
You can start the dev server by running
pnpm dev
You can then open the web page on the given link.
9. Working on Assigned Section File
First, you need to assign yourself a section either in the
For, example I decide to work with FAQs Section and my name is umer so,
Create a new branch for your changes
# create a new branch with your name
git branch -b by-umer
# move to that branch using checkout command
git checkout by-umer
# or you can directly create a new branch and move to it by running a single command
git checkout -b by-umer
# make sure to use your name, not mine 🤡
git checkout -b by-<your-name>
You can list all the branches by running git branch
The *
Make your changes in the codebase. If I have picked up FAQs section then my working file would be src/components/Hero.astro in the code base
View Your Changes by running the dev server on the localhost url.
Stage your changes by adding files to git for tracking
# add all files
gitadd.
# or add a specific file
gitadd<file-name>
Commit your changes
git commit -m"a meaning full commit message that tells details about the change you made"
Push your branch to the remote repository
git push origin by-umer
# or
git push origin by-<your-name>
Create a Pull Request :
After pushing your branch, you'll typically see a message in the command line output that includes a URL to create a pull request. You can use that URL to open a web browser and create the PR manually.
Never ever make changes directly to the main branch or branch of other collaboraters.
Want to print your doc? This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (