Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Add default Grunt/Gulp file #148

Open
westonruter opened this issue Mar 4, 2016 · 5 comments
Open

Add default Grunt/Gulp file #148

westonruter opened this issue Mar 4, 2016 · 5 comments
Assignees

Comments

@westonruter
Copy link
Contributor

There is a Gruntfile.js in wp-foo-bar which can be moved into this project and added in to foo-bar either as a symlink or required-in as a dependency that the project Gulp/Grunt file can extend/integrate.

@mehigh mehigh self-assigned this Mar 4, 2016
@westonruter
Copy link
Contributor Author

I suggest that we might even be able to eliminate svn-push in favor of re-using Grunt script, like using grunt-wp-deploy.

Here's one such Gruntfile: https://github.com/xwp/wp-customize-posts/blob/develop/Gruntfile.js

If we could factor out the logic from this Gruntfile into dev-lib to allow it to be require'd into a project's specific Gruntfile, then we could eliminate having to duplicate the Gruntfile for each project. And we could start to standardize on using Grunt/Gulp for doing scripting where modules already exist instead of using Bash or PHP directly, if that makes sense.

@westonruter
Copy link
Contributor Author

Ideally we'd be able to just symlink to a the Gruntfile.js inside of the dev-lib submodule and have it automatically configured to do the right thing. This is preferred over having to copy the Gruntfile.js out into the repo. Additional configurations could be provided for the Gruntfile.js via the package.json or perhaps .dev-lib.

@kopepasah
Copy link
Contributor

How would we handle cases where the Grunt configuration is quite different? For example, some project may not need many of the tasks included, or may have separate locations for files to process.

If we use something like load-grunt-config, this would allow us to have one Grunt and separate out tasks into their own location, allowing a specific project to provide its own tasks (if needed).

@mehigh
Copy link
Member

mehigh commented Jun 4, 2017

@kopepasah I would expect the configuration file to be filled in on a per-project basis, as the paths are always unique. And one can eventually turn on/off features using flags setup to true or false in the config file.

@mehigh
Copy link
Member

mehigh commented Jul 24, 2017

This is being worked on in #245
We've done good progress on a general FE workflow, but the scripts can be further improved upon once we start using this in production.

There was one thing we discovered:
"Ideally we'd be able to just symlink to a the Gruntfile.js inside of the dev-lib submodule and have it automatically configured to do the right thing. This is preferred over having to copy the Gruntfile.js out into the repo.".
We need the package.json to be outside of the dev-lib folder because if we try to run it from inside the dev-lib folder, we can't "go outside of the directory" to do our thing.

At this moment it means one needs to copy the package.json outside. This also contains configuration data (what's the theme folder and what js files need compiling / etc., what plug-ins require js compilation) so it makes sense to stay in the project's repository.

The actual tasks are referenced from inside the dev-lib from the package.json, and this makes a minimal amount of additions to the projects repository.

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

No branches or pull requests

3 participants