refactor: handle packaged node_modules
Issue: Follow-up: Remove sed command that overwrites c... (#427 - closed)
What does this MR do and why?
By default, the node_modules directory is ignored during yarn pack. To get around this, we renamed node_modules to bundled_node_modules. However, this poses an issue when upgrading VSCode fork to 1.93.1, which includes changes that rely on the presence of the node_modules directory.
This refactor aims to gracefully solve this issue by:
- Add
postinstallscript to handle renamingbundled_node_modulestonode_modulesas part of the package's install lifecycle. - Move the
node_modulesrenaming logic fromvscode-buildMakefile toweb-idepackage'sprepackhook as a way to colocate this renaming logic. - Update
vscode-bootstrapto use node_modules instead of bundled_node_modules.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
How to set up and validate locally
Installing in main project
- In Web IDE repo, run
./scripts/pack-web-ide-package.sh. Copy path to package archive generated at the end of the script. - In
gitlabrepo, runyarn add <path_to_package_archive>. - Inspect that the
node_modulesdirectory in the@gitlab/web-idepackage is successfully renamed by runningls node_modules/@gitlab/web-ide/dist/public/vscodein the root of the main project. - Ensure that the Web IDE loads as expected
Installing Example App
- In the Web IDE repo, run
yarn clean - Run
yarn start:example - Ensure that the Example App successfully starts
Edited by Enrique Alcántara