|
1 | | -# How to upgrade to next vscode and monaco-editor version |
| 1 | +# How to upgrade to next vscode and monaco-editor versions |
2 | 2 |
|
3 | 3 | ## Preparation |
4 | 4 |
|
| 5 | +- It is assumed `monaco-vscode-api`, `vscode` and `monaco-editor` repos are cloned locally on the same directory level. `monaco-editor` is not required, but helpful |
| 6 | + |
| 7 | +## vscode repository |
| 8 | + |
5 | 9 | - Get the new vscode commit from the new monaco-editor release version (in the package.json there is a `vscodeRef` field) |
6 | | -- Open the vscode repo, reset to the previous vscodeRef commit |
7 | | -- Apply the current patch: `patch -p1 < /path/to/monaco-vscode-api/scripts/vscode.patch` |
| 10 | +- Go to the vscode repo directory, reset to the previous vscodeRef commit |
| 11 | +- Apply the current patch: `patch -p1 < ../monaco-vscode-api/scripts/vscode.patch` |
8 | 12 | - `git stash` |
9 | | -- checkout new vscodeRef commit |
| 13 | +- Checkout new vscodeRef commit |
10 | 14 | - `git stash pop` |
11 | | -- resolve conflicts, update code... |
12 | | -- generate new patch: `git diff --staged > /path/to/monaco-vscode-api/scripts/vscode.patch` |
| 15 | +- Resolve conflicts / update code (e.g. broken imports) |
| 16 | +- Generate new patch: `git diff --staged > ../monaco-vscode-api/scripts/vscode.patch` |
13 | 17 |
|
14 | | -## the monaco-vscode-api side |
| 18 | +## monaco-vscode-api repository |
15 | 19 |
|
16 | | -- update monaco-editor (and other dependencies) and update to the new `vscodeRef` |
17 | | -- wait for the new vscode version to be downloaded and built |
| 20 | +- Update `monaco-editor` and other dependencies and update to the new `vscodeRef` from above |
| 21 | + - Run `npx @vscode/dts dev` afterwards to update the `vscode.proposed.xxx.d.ts` files. It fixes potential errors in `api.ts` |
| 22 | +- Wait for the new vscode version to be downloaded and built |
18 | 23 | - Fix errors, adapt code, build, include the `vscode.patch` into this commit |
19 | | -- update demo |
| 24 | + - Do not hesitate to run the eslint autofix, it gets rid of the majority of your errors |
| 25 | + - Implement missing services. This is easily observable seem when running the demo (see next point) |
| 26 | +- Update demo |
| 27 | + - Update dependencies |
| 28 | + - Implement improvements dependening on the new features available from vscode (optional) |
20 | 29 |
|
21 | | -## Further points (needs polishing / ne integrated properly) |
| 30 | +## Hints: |
22 | 31 |
|
23 | | -- Do not hesitate to run the eslint autofix, it gets rid of the majority of your errors |
24 | | -- I've just realized we need to run npx @vscode/dts dev after an update (to upate the vscode.proposed.xxx.d.ts files): it fixes the error in api.ts |
25 | | -- The remaining errors in missing-services.ts are not hard to fix |
26 | | -- Implement missing services (usually seem when running the demo) |
| 32 | +Use repo log viewers and check the last update branch when in doubt |
0 commit comments