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

Replace Grunt scripts with NPM scripts #439

Closed
Benjaki2 opened this issue Jul 28, 2017 · 7 comments
Closed

Replace Grunt scripts with NPM scripts #439

Benjaki2 opened this issue Jul 28, 2017 · 7 comments
Assignees

Comments

@Benjaki2
Copy link
Collaborator

  • Gruntfile is currently ~800 lines of code that does too much in one place
  • We can break these tasks into separate bash scripts inside a task folder.
  • Won't rely on grunt/gulp wrappers which will remove unneeded 3rd party dependancies
@localjo
Copy link
Contributor

localjo commented Aug 3, 2017

Happy to help with this

@ZachTRice
Copy link
Contributor

Since we will be converting this soon, I'm going to add additional tasks here that we need which haven't been added to grunt.

  • Clean up the web/config/metadata/** markdown files after they have been converted.
    remove:markdown: ["web/config/metadata/**/*.md"],
    This can be added to the config process after the options-repo markdown files have been converted to html.

@localjo
Copy link
Contributor

localjo commented Dec 29, 2017

One thing that would be nice when we tackle this is to add a progress indicator to the GIB GetCapabilities request, since that can take quite a long time and it's not clear if progress is being made or not.

@localjo localjo changed the title Migrating from grunt to npm scripts Overhaul Build Scripts Dec 29, 2017
@localjo
Copy link
Contributor

localjo commented Dec 29, 2017

I've spent a lot of time looking at our build scripts this week, and formed a clearer picture of what we've got going on here;

  • We've got a complex mix of Grunt, Bash and Python scripts running build tasks. They're all interdependent but the meat of the work is done by the Python scripts.
  • The build tasks are (sort of) divided into three stages;
    1. Build the options repo and make a request to GetCapabilities
    2. Build assets for the Worldview repo
    3. Combine the results of the previous two builds into one
  • There's a lot of unnecessary storage of intermediate files on the file system that can be removed to simplify the process
  • We're using several different interfaces to invoke the build scripts; sometimes we're running things from npm scripts, sometimes we're running the same thing via grunt, sometimes there's a custom bash script that runs the build scripts in strange orders. We should aim to simplify all of this to have a straightforward npm run build command that does everything simply.

I've done some of this work in #647 to move us in the right direction, but there's still a lot of work to do.

@localjo
Copy link
Contributor

localjo commented Dec 29, 2017

We can also relocate /web/build to /build and serve that in development, which will serve to speed up our development process by allowing us to see the final results of the build with string replacements, and enable hot reloading of JavaScript, CSS and HTML changes.

@localjo
Copy link
Contributor

localjo commented Jan 9, 2018

This may be the time to address #661

After #503 is merged, we should rearrange all of our build scripts into a single directory, instead of having them spread between root, /bin, /tasks, and /deploy, etc.

@localjo
Copy link
Contributor

localjo commented Jan 23, 2018

Build scripts ended up being reorganized in #503 which included a lot of other optimizations to build scripts. We still need to eliminate Grunt, but it's now being used for just a small number of trivial tasks that should be easy to eliminate.

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

No branches or pull requests

5 participants