Skip to content

Commit 57f38e1

Browse files
authored
Merge pull request #1780 from hydephp/update-updating-documentation
Internal: Update the updating documentation
2 parents 50b5ce7 + cc23f1a commit 57f38e1

File tree

1 file changed

+42
-56
lines changed

1 file changed

+42
-56
lines changed

docs/digging-deeper/updating-hyde.md

Lines changed: 42 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -33,83 +33,49 @@ it is still possible that some edge cases slip through. This means that a bug fi
3333

3434
Obligatory related XKCD: [https://xkcd.com/1172](https://xkcd.com/1172)
3535

36+
### Before you start
3637

37-
## Methods
38+
Before you perform an update, please make sure you have a backup of your project.
39+
Using Git is highly recommended as it allows you to easily roll back changes if something goes wrong.
3840

39-
### Which method?
41+
## Update to a major version
4042

41-
Depending on how you installed Hyde, there are a few different ways to update it.
43+
When updating to a major version, you should read the release notes and the upgrade guide for that version.
44+
If you are updating multiple major versions at once, it's recommended to update one major version at a time,
45+
following the upgrade guide for each version. After following the upgrade guide, you can follow the post-update instructions below.
4246

43-
We have a few methods documented here. The [Git method](#using-git) is recommended as it is the easiest and safest way to
44-
update your project. If you are not using Git, you can still update your project using any of the [manual methods](#manual-update).
47+
## Updating to a minor or patch version
4548

46-
Regardless of the method you use, make sure you follow the [post-update instructions](#post-update-instructions) at the end.
47-
48-
### Updating just the Framework
49-
50-
If you just want to update the framework patch version, you can do so by running the following command:
49+
Updating a minor or patch version is easy using Composer. Just run the following command:
5150

5251
```bash
53-
composer update hyde/framework
52+
composer update hyde/* --with-dependencies
5453
```
5554

56-
While the same can still be done for minor versions, it's best to also update your project scaffolding and resources to
57-
ensure that everything is up to date, for which you should use the methods below.
58-
59-
### Using Git
55+
Note that if you have hardcoded a version constraint in your `composer.json` file, you may need to update it manually.
56+
You can always refer to the `composer.json` file in the HydePHP repository if you need a reference.
6057

61-
First, make sure you have a remote set up for the base project repository.
58+
## Alternate update methods
6259

63-
```bash
64-
git remote add upstream https://github.com/hydephp/hyde.git
65-
```
60+
### Updating using Git (advanced)
6661

67-
Then pull the latest release from the upstream repository.
62+
If you are using Git, you can set the `hydephp/hyde` repository as a Git remote and merge in the changes that way:
6863

6964
```bash
70-
git pull upstream master
71-
```
65+
git remote add hyde https://github.com/hydephp/hyde.git
66+
git fetch hyde
67+
git merge hyde/master # OR: Replace 'master' with the version tag you want to update to
7268

73-
After this, you should update your composer dependencies:
69+
# Take care of any merge conflicts that arise, then install the updated dependencies
7470

75-
```bash
7671
composer update
7772
```
7873

79-
Next, follow the post-update instructions.
80-
81-
### Manual Update
82-
83-
If you are not using Git, you can still update your project. This is a bit more involved, but it is still possible.
84-
85-
1. First, you will need to download the latest release archive from the [releases page](https://github.com/hydephp/hyde/releases).
86-
2. Then extract the archive, and copy the contents into your project directory.
87-
88-
Since this may overwrite modified files, it may be safer to use the [hard update](#hard-update) method.
89-
90-
### Hard Update
74+
### Hard update using release archive
9175

92-
If you are having trouble updating your project, you can try a hard update. In short, this approach consists of creating
93-
a brand new project and copying over only your source and resource files. If you do not want to use Git, this may be
94-
the safest option as you won't be overriding any of your existing files.
76+
An alternate way to update your project is to essentially do a hard reset. This is only recommended if you haven't done many modifications to the HydePHP files.
9577

96-
If you have changed any other files, for example in the App directory, you will need to update those files manually as well.
97-
The same goes if you have created any custom Blade components or have modified Hyde ones.
98-
99-
**Here is an example CLI workflow, but you can do the same using a graphical file manager.**
100-
101-
```bash
102-
mv my-project my-project-old
103-
composer create-project hyde/hyde my-project
104-
105-
cp -r my-old-project/_pages my-project/content/_pages
106-
cp -r my-old-project/_posts my-project/content/_posts
107-
cp -r my-old-project/_media my-project/content/_media
108-
cp -r my-old-project/_docs my-project/content/_docs
109-
cp -r my-old-project/config my-project/config
110-
```
111-
112-
Next, follow the post-update instructions. After verifying that everything is working, you can delete the old project directory.
78+
Essentially: Download the [latest release](https://github.com/hydephp/hyde/releases/latest) from GitHub, extract it to a new project directory, then copy over your source files and install the dependencies.
11379

11480

11581
## Post-update instructions
@@ -136,6 +102,26 @@ php hyde publish:views layouts
136102
php hyde publish:views components
137103
```
138104

105+
You may also want to download any resources that have been updated. You download these from the Zip file of the latest release on GitHub.
106+
107+
The latest release can always be found at https://github.com/hydephp/hyde/releases/latest, where you can download the source code as a `zip` file under the "Assets" section.
108+
109+
Here are the paths you may be interested in copying over: (Using Git will help a ton here as it can show you diffs of changed files, and allow you to easily merge own changes)
110+
111+
```
112+
├── app
113+
│ ├── Providers
114+
│ │ └── AppServiceProvider.php
115+
│ ├── bootstrap.php
116+
│ ├── config.php
117+
│ └── storage/
118+
├── composer.json
119+
├── package.json
120+
├── resources/
121+
├── tailwind.config.js
122+
└── webpack.mix.js
123+
```
124+
139125
Next, recompile your assets, if you are not using the built-in assets.
140126

141127
```bash

0 commit comments

Comments
 (0)