RelevanceDigital / wp-bs-starter-theme

A Bootstrap 5 WordPress Starter Theme
GNU General Public License v2.0
9 stars 4 forks source link

Add a package function to gulp #2

Open dantahoua opened 3 years ago

dantahoua commented 3 years ago

Hello! I'm really happy to have found your skeleton theme. I was using FoundationPress based on Zurb Foundation but it is now no more maintained and as Bootstrap reached the same level of possibilities with the version 5 I will switch to it right now! I can contribute by forking your repo, like adding the fr translation if you want. Let's make this theme even more useful and faster! :)

I have a suggestion, implementing a "package" function which build all the file and put them in the zip (without the node_module folder and other sources), so it's easier to update the theme on production website or even on dev website. :)

Something like:

// Create a .zip archive of the theme
function archive() {
  var time = dateFormat(new Date(), "yyyy-mm-dd_HH-MM");
  var pkg = JSON.parse(fs.readFileSync('./package.json'));
  var title = pkg.name + '_' + time + '.zip';

  return gulp.src(PATHS.package)
    .pipe($.zip(title))
    .pipe(gulp.dest('packaged'));
} 

and that was the package path variable on the foundationPress but that would be easy to adapt to your theme I think!

# Paths for the package task to include/exclude in .zip archive
  package:
    - "**/*"
    - "!**/node_modules/**"
    - "!**/packaged/**"
    - "!**/src/**"
    - "!**/codesniffer.ruleset.xml"
    - "!**/composer.json"
    - "!**/composer.lock"
    - "!**/config.yml"
    - "!**/config.default.yml"
    - "!**/gulpfile.babel.js"
    - "!**/package.json"
    - "!**/package-lock.json"
    - "!**/webpack.config.js"

Have a nice day! :)

robwent commented 3 years ago

Hi Vincent,

Thanks for the translation and BS update.

I'm not really sure about this one. If I wanted to create a zip, I just highlight all the files and right-click > create zip, but usually, I would update sites using git or ftp.

How would you use the zip, upload it through the site admin?

dantahoua commented 3 years ago

Your welcome! Just uploading through FTP, I found it just easier than clicking (and forgetting in my case) files. :) But sometimes it saved me when the website was no longer on a server I had the credential for FTP, so I could upload it with the admin.