buddypress / next-template-packs

is this the next BuddyPress template pack?
35 stars 9 forks source link

Add gruntfile or task runner of choice for bp-nouveau #121

Closed mercime closed 7 years ago

mercime commented 7 years ago

Specially for processing and linting Sass files at this point. It makes it easier for contributors to submit pull requests.

In current setup, one will need to copy over the Sass files to a separate folder from nouveau and use grunt CLI, gulp CLI, Ruby sass CLI, or npm CLI to do this. And then copy over the revised Sass file and generated CSS files to bp-nouveau. Alternatively, one can add own processor and linter in bp-nouveau and just add e.g. gruntfile, gulpfile, or ruby sass-generated elements into own gitignore

I don't know when bp-nouveau will be merged into BP core, but I will presume that the merge will be done when all issues and testing have been addressed in this repo. I expect merge sometime right after WordCamp Europe before string freeze.

mercime commented 7 years ago

Per dev chat last April 5, task runner will be added sometime, hopefully soon - https://wordpress.slack.com/archives/C02RQBYUG/p1491419356556648

hnla commented 7 years ago

Commit adds my working files for grunt tasks.

To note: This is primarily to run:

$ grunt watch

which will compile the scss changes to css from the scss directory so any changes to the partial import files will trigger compilation of the main buddypres.scss and in turn generate the css file.

$ grunt stylelint

Manually runs linting

$ grunt rtlcss

Will run a rtl version of the css file, as will $ grunt commit to run stylelint, rtlcss.

The file is scrappy but serves the simple workflow required at this stage working in the plugin version.

I envisage , when merged to core, that this set of files is redundent, we just need to modify the main BP gruntfile to include the watch task and new paths to files.

mercime commented 7 years ago

The file is scrappy but serves the simple workflow required at this stage working in the plugin version. I envisage , when merged to core, that this set of files is redundent, we just need to modify the main BP gruntfile to include the watch task and new paths to files.

Agreed. Thanks hnla. Will be testing this in a little bit.

mercime commented 7 years ago

Tested this a few minutes ago and got Warning: Task "uglify" not found. Use --force to continue.

Checked out Gruntfile.js and there's no uglify configured there while we're registering uglify as default task grunt.registerTask('default', ['uglify', 'postcss']); See https://github.com/gruntjs/grunt-contrib-uglify#usage-examples

I understand that this was primarily uploaded to take care of the Sass files so we can help out. Thank you. Just checking if the uglify configuration was mistakenly removed when you cleaned up your Gruntfile.js before committing. If not, then disregard this message and I'll move on to other tickets 👍

mercime commented 7 years ago

We should add "Do not run grunt in command line after npm install so that the package.json will not be updated for this project? See what happened in this commit.

Will revert the package.json to what you uploaded earlier.

hnla commented 7 years ago

Not sure what happened there, so running '$ grunt` after install updates package.json? There's a lot I don't comprehend about grunt.

As for the uglify task, it's odd as I don't get errors but the registerTask is a legacy so probably best to simply comment out or delete, were installing the module but as you point out there's no task setup and no particular need for it in this grunt file.

ntwb commented 7 years ago

Can this issue be assigned to me please 😄

hnla commented 7 years ago

Asked lead devs to sort out the access as you're not shown in the assignees listing for some reason.

Where making any changes to the gruntfile can we ensure that the workflow is maintained, it's admittedly messy & could do with tidying up but nervous about breaking workflow as trying to commit quite a bit at the moment with what time available.

ntwb commented 7 years ago

PR #136: Grunt: Major refactor of Gruntfile.js • There are 3 primary Grunt tasks now: • grunt lint runs the JSHint and stylelint grunt tasks • grunt build builds the CSS & RTL CSS from SCSS • grunt runs both grunt lint and grunt build

hnla commented 7 years ago

@netweb Any reason we shouldn't just merge this straight into 'master'?

ntwb commented 7 years ago

@hnla, it was late last night and I wanted to double check things this morning with fresh eyes 👀

hnla commented 7 years ago

@netweb understood, thanks for sorting.