Skip to content

Commit

Permalink
Merge pull request #366 from CodinGame/improve-patch-management
Browse files Browse the repository at this point in the history
Improve patch management
  • Loading branch information
CGNonofr authored Mar 12, 2024
2 parents 43b96ae + 5589543 commit 0cf636c
Show file tree
Hide file tree
Showing 67 changed files with 7,344 additions and 6,398 deletions.
1 change: 0 additions & 1 deletion demo/src/features/customView.views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ registerCustomView({
id: 'custom-view',
name: 'Custom demo view',
order: 0,
default: true,
renderBody: function (container: HTMLElement): monaco.IDisposable {
container.style.display = 'flex'
container.style.alignItems = 'center'
Expand Down
1 change: 0 additions & 1 deletion demo/src/features/customView.workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ registerCustomView({
id: 'custom-view',
name: 'Custom demo view',
order: 0,
default: true,
renderBody: function (container: HTMLElement): monaco.IDisposable {
container.style.display = 'flex'
container.style.alignItems = 'center'
Expand Down
5 changes: 4 additions & 1 deletion demo/src/setup.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ export const constructOptions: IWorkbenchConstructionOptions = {
orientation: 0,
groups: [{ size: 1 }, { size: 1 }]
}
}
},
views: [{
id: 'custom-view'
}]
},
welcomeBanner: {
message: 'Welcome in monaco-vscode-api demo'
Expand Down
1 change: 1 addition & 0 deletions demo/src/setup.views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import getViewsServiceOverride, {
Position
} from '@codingame/monaco-vscode-views-service-override'
import { openNewCodeEditor } from './features/editor'
import './features/customView.views'
import { commonServices, constructOptions, remoteAuthority, userDataProvider } from './setup.common'

const container = document.createElement('div')
Expand Down
1 change: 1 addition & 0 deletions demo/src/setup.workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import getQuickAccessServiceOverride from '@codingame/monaco-vscode-quickaccess-
import { BrowserStorageService } from '@codingame/monaco-vscode-storage-service-override'
import { ExtensionHostKind } from '@codingame/monaco-vscode-extensions-service-override'
import { registerExtension } from 'vscode/extensions'
import './features/customView.workbench'
import { commonServices, constructOptions, remoteAuthority, userDataProvider } from './setup.common'

const container = document.createElement('div')
Expand Down
9 changes: 4 additions & 5 deletions docs/vscode_monaco_upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

- Get The tag of the VSCode version from the [VSCode github](https://github.com/microsoft/vscode/tags)
- Go to the VSCode repo directory, reset to the previous VSCode tag (`config.vscode.ref` from monaco-vscode-api `package.json`)
- Apply the current patch: `patch -p1 < ../monaco-vscode-api/scripts/vscode.patch`
- `git stash`
- Checkout new VSCode tag
- `git stash pop`
- Apply the current patch: `git am ../monaco-vscode-api/vscode-paches/*.patch`
- Fetch the new tag: `git fetch origin <tag>`
- rebase on the new tag: `git rebase <tag>`
- Resolve conflicts / update code (e.g. broken imports)
- Generate new patch: `git diff --staged > ../monaco-vscode-api/scripts/vscode.patch`
- Generate new patch: `rm -rf ../monaco-vscode-api/vscode-paches && git format-patch <tag>.. -o '../monaco-vscode-api/vscode-paches'`

## monaco-vscode-api repository

Expand Down
4 changes: 2 additions & 2 deletions scripts/install-vscode
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output_directory="`pwd`/vscode"
loc_output_directory="`pwd`/vscode-loc"
extension_output_directory="`pwd`/vscode-default-extensions"
extension_node_output_directory="`pwd`/vscode-default-extensions-node"
patch_file="`pwd`/scripts/vscode.patch"
patch_directory="`pwd`/vscode-paches"
version_info=$output_directory/version.info

if [[ -e $version_info && $(cat $version_info) == $vscodeRef ]]; then
Expand All @@ -34,7 +34,7 @@ yarn install --ignore-scripts
yarn postinstall || true

echo "Patching vscode..."
patch -p1 < $patch_file
find "$patch_directory" -type f -name '*.patch' -print0 | sort -z | xargs -t -0 -n 1 patch -p1 -i

echo "Installing build dependencies"
cd build
Expand Down
Loading

0 comments on commit 0cf636c

Please sign in to comment.