Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLUID-5978: Infusion build distributions #760

Merged
merged 7 commits into from
Oct 24, 2016

Conversation

jobara
Copy link
Member

@jobara jobara commented Oct 6, 2016

Adding a grunt task and prepublish script for building a dist directory.

https://issues.fluidproject.org/browse/FLUID-5978

Creates a "dist" directory containing pre-built versions of infusion based on configuration defined
in the distributions grunt task. Note: that dist only contains files that are processed by a builid.
Other files should be sourced from the src directory.

Still need to copy over the css files generated by Stylus.
@jobara jobara added this to the Infusion 2.0 Release milestone Oct 6, 2016

var concatTask = options.compress ? "uglify:" : "concat:";
var tasks = [
"clean:build",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jobara - this pull looks generally good. Whilst we are touching the build scripts in this area, I thought it might be appropriate to fix up our clean:build strategy a little more:

Since we merged in #720 I feel we've gone from deleting too much build junk to deleting too little. We now accumulate an entire copy of the all the frameworks's JS source in build/ after a build, even though it is all included within one of the build files themselves.
Could we perhaps have a clean:postBuild task which, say, deletes something like build/src/**.js - these redundant files are very confusing in an IDE, since as well as having one copy of all the framework's source per project that depends on it, we are now likely to double this by each of those copies now having an extra copy within build/src - Cheers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amb26 we could do that, but not all of the js files are actually part of the concatenated file. For example the compatibility files included with the Uploader. I can think of the following three options, please let me know what you think.

  • Leave things as is
  • Delete the build directory again ( with the dist directory, I don't think @waharnum's use case is still necessary. were there others? )
  • Attempt to reuse the file list that was used to do the concatenation to facilitate the deletion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third option would be nice, if it didn't seem to involve too much work - otherwise we could just leave things are they are

After a build, the js files incuded in the single concatenated js file are removed from the build directory.

After distributions are built, other build files/resources are removed (i.e. build directory, stylus generated files, etc.)
@jobara
Copy link
Member Author

jobara commented Oct 23, 2016

@amb26 I believe I have option 3 working and also did some cleanup after distributions are built. This is ready for more review.

@amb26 amb26 merged commit 33e0a65 into fluid-project:master Oct 24, 2016
@amb26
Copy link
Member

amb26 commented Oct 24, 2016

Thanks, @jobara - this looks great! Now that we are using the prepublish lifecycle script, we should now make sure to update your pull fluid-project/fluid-publish#5 so that it executes this step (if it exists in package.json) before publishing artefacts to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants