You could try the Sage 9.x update approach for Sage 10:
- (Should already be the case) The whole project is already under version control (assuming
git
). - Project (working) directory is clean.
- Outside of the project directory, create a new sage 10 project from latest commit:
composer create-project roots/sage sage10 dev-main
- Move the whole content (except git-ignored directories as
vendor
andnode_modules
(if existing)) from the directory of the newly created, unmodified Sage 10 theme (directory namedsage10
in this example) into the project directory, overwrite everything with the new files. - Use git CLI; a git-supporting IDE (like
Visual Studio Code
) and/or another GUI (e.g.TortoiseGit
) to revert to/manually merge your modifications on top of the base Sage 10 theme, notablycomposer.json
;style.css
andpackage.json
.
The lockfiles could be reverted or reused - but I usually remove them and regenerate them with the new dependencies (it usually works just fine). - Re-install the dependencies with the new files (
composer install
;npm install
/yarn install
). - Adjust the configuration of the new build tool in newer Sage 10 iterations (
bud
instead oflaravel-mix
) (bud
docs). Forwebpack
configuration and other tasksbud
doesn’t have an equivalent configuration or extension yet, use thebud
API to modify the resultingwebpack
configuration directly. Asbud
also generateswebpack
configuration aslaravel-mix
did, the samewebpack
configuration should be reusable without significant modifications. - Re-build the project (
yarn build
(which invokesbud
)).
Fix or correct any errors that occur during building (e.g. missed dependencies that weren’t re-applied to the new Sage 10 files). - Test the result, does everything still work and look the same?
- Commit all the changes now, either directly to the default branch or to a dedicated branch for further testing. - Done.