ITADN
o-l-a-v/o-l-a-v.github.io
o-l-a-v/o-l-a-v.github.io · 文件
文件最后提交记录最后更新时间
README.md

Readme

About

Here I'll maybe, eventually, create docs, guides and a blog. Created with Docusaurus, hosted in Cloudflare Pages (primary) and GitHub Pages (secondary).

Project help

Maintain

Upgrade packages and dependencies using Yarn. Try to run locally and build before pushing the changes.

# Navigate to the website folder
cd website

# Update NodeJS with fnm - Use `pwsh -NoProfile` if "error: Can't download the requested binary: Access is denied. (os error 5)"
fnm install --lts --corepack-enabled
fnm default <new_version>
fnm use <new_version>
fnm list
fnm uninstall <old_version(s)>

# Update package manager with Corepack
corepack up

# Update Node packages in packages.json
yarn upgrade-interactive

# Update all Node packages, not only those in packages.json, but those in yarn.lock too
yarn up --recursive '*'

# Deduplicate
yarn dedupe --check

# Update vulnearble package
## Regular update first
yarn upgrade-interactive
## If that did not help - Find out what uses it
yarn why '<package_name>'
## Upgrade packages using it, if update is available. Check npmjs.com.
yarn up --recursive '<package_name>'

# Yarn NPM audit example
yarn npm audit --recursive --severity high

Run locally

See edits to pages live.

# If building clean from what's in Git
git clean --force -d -x
yarn install

# Run
## Using NodeJS since 22
node --run start
## Using Yarn
yarn start

Build locally

# Build, will also to check for broken anchors and links vs. running it locally
## Using NodeJS since 22
node --run build
## Using Yarn
yarn build

# Build clean and time how long it took
node --run clear; $Stopwatch = [System.Diagnostics.Stopwatch]::StartNew(); node --run build; $Stopwatch.Stop(); $Stopwatch.Elapsed.ToString()

Deploy to GitHub pages from local

# If building clean from what's in Git
git clean --force -d -x
yarn install

# Deploy
## Using NodeJS since 22
node --run clear; $env:GIT_USER = [string] 'o-l-a-v'; node --run deploy
## Using Yarn
yarn docusaurus clear; $env:GIT_USER = [string] 'o-l-a-v'; yarn deploy

Other learnings

Where is the Yarn global cache location on Windows?

%LOCALAPPDATA%\Yarn\Berry\cache