Skip to:
Content

BuddyPress.org

Changeset 12574


Ignore:
Timestamp:
03/25/2020 05:52:59 AM (7 years ago)
Author:
imath
Message:

Update Grunt tasks & .gitignore to match BP Blocks needs

  • The makepot task is now using the WP CLI wp i18n make-pot command.
  • Exclude JavaScript Files generated by Parcel/Babel from jsvalidate, jshint & uglify tasks.
  • Add new tasks to build & minify BP Blocks files.

See #8048

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/.gitignore

    r11038 r12574  
    22phpunit.xml
    33.idea
     4.cache
    45
    56lib-cov
  • trunk/.jshintignore

    r11763 r12574  
    22src/bp-core/js/vendor/**/*
    33src/bp-messages/js/autocomplete/*
     4
     5// Blocks Scripts
     6src/**/js/blocks/*.js
     7src/**/js/block-components/*.js
     8src/**/js/block-components/**/*.js
     9src/bp-core/js/block-components.js
  • trunk/Gruntfile.js

    r12552 r12574  
    1616                BP_JS = [
    1717                        '**/*.js'
     18                ],
     19
     20                BP_EXCLUDED_JS = [
     21                        '!**/js/blocks/*.js',
     22                        '!**/js/block-components/*.js',
     23                        '!**/js/block-components/**/*.js',
     24                        '!**/js/block-components.js'
    1825                ],
    1926
    … …  
    165172                        }
    166173                },
    167                 makepot: {
    168                         target: {
    169                                 options: {
    170                                         cwd: BUILD_DIR,
    171                                         domainPath: '.',
    172                                         mainFile: 'bp-loader.php',
    173                                         potFilename: 'buddypress.pot',
    174                                         processPot: function( pot ) {
    175                                                 pot.headers['report-msgid-bugs-to'] = 'https://buddypress.trac.wordpress.org';
    176                                                 pot.headers['last-translator'] = 'JOHN JAMES JACOBY <jjj@buddypress.org>';
    177                                                 pot.headers['language-team'] = 'ENGLISH <jjj@buddypress.org>';
    178                                                 return pot;
    179                                         },
    180                                         type: 'wp-plugin'
    181                                 }
    182                         }
    183                 },
    184174                imagemin: {
    185175                        core: {
    … …  
    202192                                                dot: true,
    203193                                                expand: true,
    204                                                 src: ['**', '!**/.{svn,git}/**'].concat( BP_EXCLUDED_MISC )
     194                                                src: ['**', '!**/.{svn,git,cache}/**', '!js/**'].concat( BP_EXCLUDED_MISC )
    205195                                        },
    206196                                        {
    … …  
    246236                                expand: true,
    247237                                ext: '.min.js',
    248                                 src: BP_JS
     238                                src: BP_JS.concat( BP_EXCLUDED_JS, BP_EXCLUDED_MISC )
    249239                        }
    250240                },
    … …  
    333323                                cwd: BUILD_DIR,
    334324                                stdout: false
     325                        },
     326                        makepot: {
     327                                command: 'wp i18n make-pot build build/buddypress.pot --headers=\'{"Project-Id-Version": "BuddyPress", "Report-Msgid-Bugs-To": "https://buddypress.trac.wordpress.org", "Last-Translator": "JOHN JAMES JACOBY <jjj@buddypress.org>", "Language-Team": "ENGLISH <jjj@buddypress.org>"}\'',
     328                                stdout: true
     329                        },
     330                        blocks_src: {
     331                                command: 'npm run dev',
     332                                cwd: SOURCE_DIR,
     333                                stdout: true
     334                        },
     335                        blocks_build: {
     336                                command: 'npm run build',
     337                                cwd: SOURCE_DIR,
     338                                stdout: true
    335339                        }
    336340                },
    … …  
    343347                        build: {
    344348                                files: {
    345                                         src: [BUILD_DIR + '/**/*.js']
     349                                        src: [BUILD_DIR + '/**/*.js'].concat( BP_EXCLUDED_JS, BP_EXCLUDED_MISC )
    346350                                }
    347351                        },
    348352                        src: {
    349353                                files: {
    350                                         src: [SOURCE_DIR + '/**/*.js'].concat( BP_EXCLUDED_MISC )
     354                                        src: [SOURCE_DIR + '/**/*.js'].concat( BP_EXCLUDED_JS, BP_EXCLUDED_MISC )
    351355                                }
    352356                        }
    … …  
    368372         */
    369373        grunt.registerTask( 'src',     ['checkDependencies', 'jsvalidate:src', 'jshint', 'stylelint', 'sass', 'postcss', 'rtlcss'] );
     374        grunt.registerTask( 'makepot', ['exec:makepot'] );
    370375        grunt.registerTask( 'commit',  ['src', 'checktextdomain', 'imagemin', 'phplint', 'exec:phpcompat'] );
    371376        grunt.registerTask( 'bp_rest', [ 'exec:rest_api', 'copy:bp_rest_components', 'copy:bp_rest_core', 'clean:bp_rest' ] );
    372         grunt.registerTask( 'build',   ['commit', 'clean:all', 'copy:files', 'uglify', 'jsvalidate:build', 'cssmin', 'bp_rest', 'makepot', 'exec:bpdefault', 'exec:cli'] );
     377        grunt.registerTask( 'build',   ['commit', 'clean:all', 'copy:files', 'uglify:core', 'jsvalidate:build', 'exec:blocks_src', 'cssmin', 'bp_rest', 'makepot', 'exec:blocks_build', 'exec:bpdefault', 'exec:cli'] );
    373378        grunt.registerTask( 'release', ['build'] );
    374379
  • trunk/composer.json

    r12278 r12574  
    3232        },
    3333        "require-dev": {
    34                 "phpcompatibility/phpcompatibility-wp": "*",
     34                "phpcompatibility/phpcompatibility-wp": "*",
    3535                "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
    3636        }
Note: See TracChangeset for help on using the changeset viewer.