My new favoured approach for sourcing Infusion as a front-end dependency in other projects

Harnum, Alan aharnum at ocadu.ca
Mon Sep 12 14:05:57 UTC 2016


Hi Justin,

No, this approach does not save Infusion to the git repository – off the top of my head, I suspect this approach won't work if an NPM package is created from the MyL3 code, if nothing else because of the devDependencies issues from the project itself needing to install Grunt to be built.

From: Justin Obara <obara.justin at gmail.com<mailto:obara.justin at gmail.com>>
Date: Monday, September 12, 2016 at 9:06 AM
To: Alan Harnum <aharnum at ocadu.ca<mailto:aharnum at ocadu.ca>>
Cc: Fluid Work <fluid-work at fluidproject.org<mailto:fluid-work at fluidproject.org>>
Subject: Re: My new favoured approach for sourcing Infusion as a front-end dependency in other projects

Hi Alan,

Thanks for sharing your strategy. I have a question about your approach. Do you save the Infusion library to git? If not, are you able to create an NPM package for your MyL3 code that also includes Infusion at the correct location?

Thanks
Justin



On September 9, 2016 at 10:56:49 AM, Harnum, Alan (aharnum at ocadu.ca<mailto:aharnum at ocadu.ca>) wrote:

I wanted to draw the community's attention to the approach I've taken for sourcing Infusion as a front-end dependency here in my ongoing MyL3 work: https://github.com/waharnum/myl3/blob/FLOE-471/Gruntfile.js in light of recent discussion (http://lists.idrc.ocad.ca/pipermail/fluid-work/2016-August/010072.html) – while still not especially elegant, it's a big improvement, and I'd recommend it to others with a similar need to manage Infusion as a third-party dependency for non-Node work.

This is possible because a recent change to the 'grunt build' task in the Infusion version published to NPM removed a cleanup step that removed the produced /build directory after making the ZIP file.

Following an 'npm install' in the project root, the "installFrontEnd" custom grunt task does the three things:

  *
uses the exec task to run 'npm install' in node_modules/infusion to get Infusion's own build dependencies
  *   uses the exec task to run 'grunt build' in node_modules/infusion to build the concerted + minified Infusion, plus source map
  *   uses the copy task to copy the built Infusion + other front end dependencies into the need src/lib and test/lib directories

This means I no longer have to keep Infusion checked into the repo or worry about making my own builds for the project, without having to deal with much greater complexity than a few additional Grunt tasks.

_______________________________________________________
fluid-work mailing list - fluid-work at lists.idrc.ocad.ca<mailto:fluid-work at lists.idrc.ocad.ca>
To unsubscribe, change settings or access archives,
see http://lists.idrc.ocad.ca/mailman/listinfo/fluid-work
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idrc.ocad.ca/pipermail/fluid-work/attachments/20160912/e5a6b4cc/attachment.html>


More information about the fluid-work mailing list