We'd like to eventually get rid of using yarn to install front end dependencies, but we still have many modules not packaged.
- We replace any packaged module with link:/usr/share/nodejs/foo (where foo is the name of packaged module) instead of version
- Sometimes we have major version mismatch between debian and upstream dependencies (for example we have webpack 4 + schema-utils 3 or mkdirp 1) when debian packages include a patch to adapt for newer APIs, upstream is still expecting the older API. In such cases, we add link:/usr/share/nodejs/foo line for such modules to force yarn to create node_modules directory when upstream want a different version.
- We run yarn install in /var/lib/gitlab so that yarn can remove node_modules directory (it is a bug in yanr 2 node-modules linker)
- /usr/share/gitlab/node_modules is a symbolic link to /var/lib/gitlab/node_modules
- /etc/gitlab/node_modules is also a symbolic link to /var/lib/gitlab/node_modules (this is required since config/webpack.config.js is actually a symbolic to /etc/gitlab/webpack.config.js)
- We use yarn berry and node-modules linker for link: protocol support