WordPress.org

Making WordPress.org

Ticket #4173: 4173.1.patch

File 4173.1.patch, 3.9 KB (added by ck3lee, 6 months ago)
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/Gruntfile.js

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/Gruntfile.js wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/Gruntfile.js
    index a858dacd4..ad7cd22a4 100644
    module.exports = function( grunt ) { 
    115115                        },
    116116                        options: { signature: false }
    117117                },
    118                 shell: {
    119                         build: {
    120                                 command: './node_modules/wpapi/lib/data/update-default-routes-json.js --endpoint=https://wordpress.org/plugins/wp-json --output=./client'
    121                         }
     118                curl: {
     119                        './client/modules/default-routes.json': 'https://wordpress.org/plugins/wp-json'
    122120                },
    123121                rtlcss: {
    124122                        options: {
    module.exports = function( grunt ) { 
    182180                        }
    183181                },
    184182                watch: {
    185                         eslint: {
    186                                 files: ['<%= eslint.files %>'],
    187                                 tasks: ['eslint']
    188                         },
    189183                        css: {
    190184                                files: ['**/*.scss', '../wporg/css/**/*scss', 'client/components/**/**.scss'],
    191185                                tasks: ['css']
     186                        },
     187                        scripts: {
     188                                files: ['**/*.jsx'],
     189                                tasks: ['webpack:build-dev'],
     190                                options: {
     191                                  atBegin: true,
     192                                }
     193                        },
     194                        eslint: {
     195                                files: ['<%= eslint.files %>'],
     196                                tasks: ['eslint']
    192197                        }
    193198                }
    194199        });
    module.exports = function( grunt ) { 
    200205        grunt.loadNpmTasks('grunt-webpack');
    201206        grunt.loadNpmTasks('grunt-eslint');
    202207        grunt.loadNpmTasks('grunt-contrib-watch');
    203         grunt.loadNpmTasks('grunt-shell');
     208        grunt.loadNpmTasks('grunt-curl');
    204209
    205210        grunt.registerTask('default', ['eslint', 'sass_globbing', 'sass', 'rtlcss:dynamic']);
    206211        grunt.registerTask('css', ['sass_globbing', 'sass', 'postcss', 'rtlcss:dynamic']);
    207         grunt.registerTask('build', ['webpack:build', 'css', 'shell:build']);
     212        grunt.registerTask('build', ['webpack:build', 'css', 'curl']);
    208213};
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/README.md

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/README.md wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/README.md
    index 393ed9ec2..f7a3b79bd 100644
     
    44
    55```
    66npm install
    7 grunt webpack:watch # Build JS client.
    8 grunt watch # Run linters, build Sass, etc.
     7grunt watch # Run linters, build Sass, JS client, etc.
    98```
    109
    1110#### Committing
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/modules/api.js

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/modules/api.js wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/modules/api.js
    index 083e91ead..35f69e73b 100644
     
    11import WPAPI from 'wpapi';
    22
    3 import routes from 'default-routes.json';
     3import routes from './default-routes.json';
    44
    55/** @type {Object} pluginDirectory Config variable */
    66const pluginDirectory = window.pluginDirectory || {};
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/package.json

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/package.json wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/package.json
    index 87f09f1cd..6447955ae 100644
     
    2929    "grunt": "^1.0.3",
    3030    "grunt-contrib-jshint": "^1.0.0",
    3131    "grunt-contrib-watch": "^1.1.0",
     32    "grunt-curl": "^2.5.1",
    3233    "grunt-eslint": "^19.0.0",
    3334    "grunt-postcss": "~0.7.2",
    3435    "grunt-rtlcss": "^2.0.1",
    3536    "grunt-sass": "~3.0.1",
    3637    "grunt-sass-globbing": "^1.5.1",
    37     "grunt-shell": "^2.1.0",
    3838    "grunt-webpack": "^1.0.11",
    3939    "history": "^2.0.0",
    4040    "jquery": "^3.1.0",
     
    5858  "dependencies": {
    5959    "i18n-calypso": "^1.7.0",
    6060    "json-loader": "^0.5.4",
    61     "wpapi": "^1.0.0"
     61    "wpapi": "^1.2.1"
    6262  }
    6363}