This guide explains how to update your s:CMS installation to the latest version while preserving your customizations.
TL;DR - Quick Update
npm run update-coreThis automated script will:
- Create a backup branch
- Fetch latest changes from upstream
- Merge updates while protecting your
usr/folder - Install new dependencies if needed
First Time Setup
If you havenβt set up the update system yet:
npm run setup-upstreamThis configures the connection to the s:CMS repository for receiving updates.
What Gets Updated vs. What Stays Yours
β Always Updated (Framework Code)
core/**- All framework components, layouts, and utilities- Core package dependencies
π‘οΈ Always Protected (Your Content)
usr/**- All your content, components, and customizationsusr/user.config.mjs- Your site configurationusr/scripts/local-packages.yml- Your site-specific npm packages (see below)
β οΈ May Need Review (Shared Files)
package.json- Dependencies may need mergingastro.config.mjs- Usually auto-merges correctly.github/workflows/**- Deployment configurationstsconfig.json,tailwind.config.js- Build configurations
Update Process Details
Step 1: Prepare Your Environment
Before updating, ensure:
- All changes are committed:
git status - Your site builds successfully:
npm run build - (Optional) Test your site:
npm run dev
Step 2: Run Update Script
npm run update-coreThe script will:
- Create backup - Saves current state to a dated branch
- Fetch changes - Downloads latest s:CMS updates
- Show preview - Lists what will change
- Ask confirmation - You decide whether to proceed
- Merge updates - Integrates changes while protecting
usr/ - Install dependencies - Updates packages if needed
Site-Specific Packages
Because npm run update-scms replaces package.json with the upstream (core) version, any packages you added manually to package.json would be wiped on every update.
The solution is usr/scripts/local-packages.yml β a YAML list of npm packages specific to your implementation. This file lives inside usr/, so it is always preserved across updates. The update script reads it and runs npm install for those packages automatically at the end of every update.
Setup
Create or edit usr/scripts/local-packages.yml:
- gsap- d3- @types/d3 # inline comments are supported- swiper@11 # pin to a specific versionYou can also install them manually at any time without running the full update:
# parse and install local packages directlygrep -E '^\s*-\s+[^#]' usr/scripts/local-packages.yml \ | sed 's/^\s*-\s*//' | sed 's/\s*#.*//' \ | xargs npm installHow It Works
During npm run update-scms the script:
- Replaces
package.jsonwith the upstream version and runsnpm install - Reads
usr/scripts/local-packages.yml - Runs
npm install <packages>for every package listed there
If the file does not exist or contains no uncommented entries, this step is silently skipped.
Step 3: Review and Test
After a successful update:
# Review what changedgit log HEAD~1..HEAD
# Test your sitenpm run dev
# Check the production buildnpm run buildStep 4: Cleanup
If everything works:
# Delete the backup branch (replace with actual branch name from script output)git branch -d backup-before-update-20260202-123456If something went wrong:
# Restore from backupgit reset --hard backup-before-update-20260202-123456Handling Merge Conflicts
If the update script reports conflicts, donβt panic! Hereβs how to resolve them:
package.json Conflicts
Strategy: Keep your dependencies + add new framework dependencies
# 1. Open package.json# 2. Look for conflict markers: <<<<<<<, =======, >>>>>>># 3. Merge dependencies from both sections# 4. Remove conflict markers# 5. Save and run:git add package.jsonnpm installgit commitExample:
<<<<<<< HEAD (your version){ "dependencies": { "astro": "^5.0.0", "my-custom-package": "^1.0.0" }}======={ "dependencies": { "astro": "^5.1.0", "photoswipe": "^5.4.4" }}>>>>>>> upstream/scms
// Resolve to:{ "dependencies": { "astro": "^5.1.0", // Use newer version "my-custom-package": "^1.0.0", // Keep your addition "photoswipe": "^5.4.4" // Add new framework dep }}astro.config.mjs Conflicts
Usually auto-merges due to the coreConfig + userConfig pattern. If not:
- Keep the merge structure
- Ensure your
usr/user.config.mjsimports are preserved - Verify the merge function is intact
Other Config Files
Review changes and decide case-by-case:
.github/workflows/**- Keep your deployment setup, review new featurestsconfig.json- Usually safe to accept upstream versiontailwind.config.js- Merge your customizations with new settings
Release Notes & Migration Guides
Always check the CHANGELOG.md after updating for:
- Breaking changes
- New features
- Manual migration steps
- Deprecated APIs
Manual Update (Alternative)
If you prefer manual control:
# 1. Create backupgit checkout -b backup-before-update
# 2. Fetch upstreamgit fetch upstream main
# 3. Merge (protecting usr/)git merge upstream/main
# 4. Resolve any conflicts# ... edit files ...git add .git commit
# 5. Install dependenciesnpm install
# 6. Testnpm run devTroubleshooting
βUpstream remote not configuredβ
Run: npm run setup-upstream
βYou have uncommitted changesβ
Commit your work first:
git add .git commit -m "Save work before update"Update fails but you want to retry
Reset and try again:
git merge --abortnpm run update-coreCompletely undo an update
Restore from backup:
git reset --hard backup-before-update-YYYYMMDD-HHMMSSBest Practices
- Update regularly - Smaller, frequent updates are easier than large jumps
- Read changelogs - Know whatβs changing before you update
- Test locally first - Always test after updating before deploying
- Keep backups - The script creates them automatically
- Donβt edit core/ - Make customizations in
usr/only
File Ownership Reference
.βββ core/ # β Never edit (framework code)β βββ components/ # Framework componentsβ βββ layouts/ # Base layoutsβ βββ utils/ # Framework utilitiesβββ usr/ # β
Your code (always protected)β βββ content/ # Your contentβ βββ pages/ # Your pagesβ βββ components/ # Your componentsβ βββ layouts/ # Your custom layoutsβ βββ user.config.mjs # Your settingsβββ astro.config.mjs # β οΈ Merges automaticallyβββ package.json # β οΈ May need manual mergeβββ tsconfig.json # β οΈ Review on updateβββ .github/workflows/ # β οΈ Your deployment (review updates)Getting Help
If you encounter issues:
- Check Discussions
- Review Issues
- Ask in the community
Remember: The core/usr separation is designed to make updates safe and painless. Your customizations in usr/ are always protected! π‘οΈ