<div dir="ltr">Vojtech, can you please help Ryan and Marek with cockpit-ovirt?<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 8, 2017 at 3:29 PM, Vojtech Szocs <span dir="ltr"><<a href="mailto:vszocs@redhat.com" target="_blank">vszocs@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello devs,<br>
<br>
following packages, intended as build-time dependencies of oVirt<br>
JavaScript projects, have been updated:<br>
<br>
* ovirt-engine-nodejs<br>
* ovirt-engine-nodejs-modules<br>
* ovirt-engine-yarn<br>
<br>
If you use those packages, please read on to learn how to adapt your<br>
project. oVirt Dashboard (master) is already adapted and you can use<br>
it as your reference.<br>
<br>
==<br>
<br>
1, move your project from npm to Yarn:<br>
<br>
- using nodejs-modules implies that your project moves from npm to<br>
Yarn, please do this as your first step<br>
- make sure to add yarn.lock file to source control: rm -rf<br>
node_modules && yarn install # generates yarn.lock<br>
- your automation/*.packages should contain something like this:<br>
<br>
ovirt-engine-nodejs-6.9.4<br>
ovirt-engine-nodejs-modules-1.<wbr>0.3<br>
ovirt-engine-yarn-0.19.1<br>
<br>
- since oVirt CI uses yum cache, always specify exact version of<br>
nodejs-modules in your automation/*.packages<br>
- in your RPM build script, make sure to set up Node.js env.: source<br>
/usr/share/ovirt-engine-<wbr>nodejs-modules/setup-env.sh<br>
<br>
==<br>
<br>
2a, dependency handling - 1st time:<br>
<br>
- clone nodejs-modules repo & update the projects.list file - add<br>
URL(s) to your project's files (package.json + yarn.lock)<br>
- bump .z in RPM Version and reset the RPM Release number, submit<br>
patch to Gerrit<br>
- in your project, update automation/*.packages to use the right<br>
nodejs-modules version<br>
<br>
2b, dependency handling - whenever your dependencies change:<br>
<br>
- clone nodejs-modules repo & bump RPM Release number, submit patch to Gerrit<br>
- in your project, update automation/*.packages to use the right<br>
nodejs-modules version<br>
<br>
==<br>
<br>
Q: how does the new nodejs-modules work?<br>
<br>
A: instead of maintaining one big package.json file to specify all<br>
dependencies of all projects (effectively forcing all projects to use<br>
single dependency tree), it contains the projects.list file with<br>
URL(s) to specific project files.<br>
<br>
When building nodejs-modules RPM, it goes through the list of URL(s),<br>
downloading project's files (package.json + yarn.lock), then<br>
downloading required dependencies (using Yarn) and collecting their<br>
.tar.gz sources. The nodejs-modules RPM therefore contains a flat list<br>
of all .tar.gz sources of all dependencies of all projects.<br>
<br>
When you source the setup-env.sh script, it does, among other things,<br>
tell Yarn to use<br>
/usr/share/ovirt-engine-<wbr>nodejs-modules/yarn-offline-<wbr>cache containing<br>
all .tar.gz sources. Then, it runs Yarn in offline mode to populate<br>
your project's node_modules directory.<br>
<br>
==<br>
<br>
Hope this helps.<br>
<br>
Regards,<br>
Vojtech<br>
______________________________<wbr>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Sandro Bonazzola<br>Better technology. Faster innovation. Powered by community collaboration.<br>See how it works at <a href="http://redhat.com" target="_blank">redhat.com</a></div></div></div></div></div></div></div></div>
</div>