Make the dist directory self contained

Description

Currently the NPM package for Infusion contains a dist directory. The dist directory includes the various js builds of Infusion. It also includes an assets directory that includes the css, and their dependencies, that are generated from Stylus files. In this way the dist directory contains all of the generated/compiled resources. However other dependencies still need to be pulled from source, for example the templates and message bundles.

When pulling down Infusion for a website or other front end project, it would be more convenient if all of the distributed resources were contained within the dist directory. That might look like including the src, with the compiled css in place, along side the js files. 

  • dist

    • src

    • infusion-all.js

    • ...

or

  • dist

    • assets

      • src

    • infusion-all.js

With either of the above structures, an integrator would only need to copy over the dist directory from node_modules/infusion.

Environment

None

Activity

Show:

Justin Obara May 5, 2021 at 5:34 PM

Instead of moving more into the dist directory, the dist directory was modified to only contain the concatenated js files and the related source maps. This was done along with changes for to migrate the build system from grunt to npm scripts.

Justin Obara September 6, 2019 at 1:52 PM

I have created dev releases for a couple of the potential solutions.

  • 3.0.0-dev.20190906T123329Z.e5ad6fbc6.FLUID-6359-src

    • Retains the src/ tree structure when copying assets to dist/assets/

  • 3.0.0-dev.20190906T123957Z.756c03fe5.FLUID-6359-collectedAssets

    • Regroups assets based on type when copying to dist/assets/

A more detailed write can be seen in the related post to the fluid-work mailing list.

http://fluid.2324889.n4.nabble.com/Potential-options-for-addressing-FLUID-6359-Make-the-dist-directory-self-contained-td10638.html

Justin Obara September 4, 2019 at 2:35 PM

May be able to use the copy task's process option to rebase the URLs.

https://github.com/gruntjs/grunt-contrib-copy#process

Justin Obara September 3, 2019 at 8:29 PM

For most of the CSS files references to images or fonts are to an adjacent directory. However, OverviewPanel.css references OpenSans from the lib directory. Similarly, the prefs framework references OpenDyslexic from the lib directory. These references are expecting three steps back. This means that these CSS, if using the previously mentioned suggestion, wouldn't be able to properly source the fonts.

 

Justin Obara August 14, 2019 at 7:01 PM

Here's an example of how the structure would look like trying to just bring in the pieces that are missing:

  • dist

    • assets

      • CSS

      • Fonts

      • Images

      • Messages

      • Templates

      • Lib (3rd party code)

      • Additional JS Files (These ones aren't typically going to be necessary, maybe we can leave them off)

        • src/components/textToSpeech/js/mockTTS.js

        • src/components/uploader/js/UploaderCompatibility-Infusion1.2.js

        • src/components/uploader/js/UploaderCompatibility-Infusion1.3.js

    • concatenated JS files and source maps

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created January 9, 2019 at 4:06 PM
Updated July 19, 2024 at 12:07 PM
Resolved May 5, 2021 at 5:34 PM