Build Tools: Revert [43826] and [43824].

Grabbing the packages directly from the Gutenberg repo was an interesting experiment, but it causes significant workflow issues, particular for folks using Windows.

See #45145.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43835 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2018-10-29 01:55:57 +00:00
parent 168120ecd0
commit 25928ac375
5 changed files with 1272 additions and 133 deletions

1
.gitignore vendored
View File

@ -22,7 +22,6 @@ wp-tests-config.php
/vendor
/src/wp-includes/js/dist
/src/wp-includes/css/dist
/packages
# Files and folders that get created in wp-content
/src/wp-content/blogs.dir

View File

@ -1,7 +1,6 @@
/* jshint node:true */
/* globals Set */
var webpackConfig = require( './webpack.config' );
var execSync = require( 'child_process' ).execSync;
module.exports = function(grunt) {
var path = require('path'),
@ -12,8 +11,6 @@ module.exports = function(grunt) {
BANNER_TEXT = '/*! This file is auto-generated */',
autoprefixer = require( 'autoprefixer' );
var packageJson = grunt.file.readJSON( 'package.json' );
// Load tasks.
require('matchdep').filterDev(['grunt-*', '!grunt-legacy-util']).forEach( grunt.loadNpmTasks );
// Load legacy utils
@ -787,24 +784,6 @@ module.exports = function(grunt) {
'qunit:compiled'
] );
grunt.registerTask( 'download-packages', function() {
var directory = 'packages';
var version = packageJson.wordpress.packagesVersion;
if ( ! grunt.file.exists( directory ) ) {
// Clone gutenberg
execSync( 'git clone https://github.com/WordPress/gutenberg.git ' + directory, { stdio: 'inherit' } );
}
execSync( 'git fetch --tags', { cwd: directory, stdio: 'inherit' } );
// Make sure we are on the correct version of Gutenberg.
execSync( 'git reset --hard ' + version, { cwd: directory, stdio: 'inherit' } );
// Install Gutenberg dependencies and build the packages.
execSync( 'npm install', { cwd: directory, stdio: 'inherit' } );
} );
grunt.renameTask( 'watch', '_watch' );
grunt.registerTask( 'watch', function() {

1336
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,40 @@
},
"dependencies": {
"@babel/polyfill": "^7.0.0",
"@wordpress/a11y": "^2.0.2",
"@wordpress/api-fetch": "^2.1.0",
"@wordpress/autop": "^2.0.2",
"@wordpress/blob": "^2.1.0",
"@wordpress/block-library": "^2.1.4",
"@wordpress/block-serialization-default-parser": "^1.0.1",
"@wordpress/blocks": "^4.0.4",
"@wordpress/components": "^4.2.1",
"@wordpress/compose": "^2.0.5",
"@wordpress/core-data": "^2.0.6",
"@wordpress/data": "^2.1.4",
"@wordpress/date": "^2.0.3",
"@wordpress/deprecated": "^2.0.2",
"@wordpress/dom": "^2.0.4",
"@wordpress/dom-ready": "^2.0.2",
"@wordpress/edit-post": "^1.0.4",
"@wordpress/editor": "^5.0.1",
"@wordpress/element": "^2.1.4",
"@wordpress/escape-html": "^1.0.1",
"@wordpress/hooks": "^2.0.2",
"@wordpress/html-entities": "^2.0.2",
"@wordpress/i18n": "^3.0.1",
"@wordpress/is-shallow-equal": "^1.1.4",
"@wordpress/keycodes": "^2.0.2",
"@wordpress/list-reusable-blocks": "^1.1.4",
"@wordpress/nux": "^2.0.6",
"@wordpress/plugins": "^2.0.5",
"@wordpress/redux-routine": "^3.0.3",
"@wordpress/rich-text": "^1.0.1",
"@wordpress/shortcode": "^2.0.2",
"@wordpress/token-list": "^1.0.2",
"@wordpress/url": "^2.1.0",
"@wordpress/viewport": "^2.0.5",
"@wordpress/wordcount": "^2.0.2",
"element-closest": "^2.0.2",
"formdata-polyfill": "^3.0.12",
"lodash": "^4.17.11",
@ -58,11 +92,5 @@
"react": "^16.5.2",
"react-dom": "^16.5.2",
"whatwg-fetch": "^3.0.0"
},
"scripts": {
"postinstall": "grunt download-packages"
},
"wordpress": {
"packagesVersion": "v4.1.0"
}
}

View File

@ -16,7 +16,6 @@ const CustomTemplatedPathPlugin = require( '@wordpress/custom-templated-path-web
const LibraryExportDefaultPlugin = require( '@wordpress/library-export-default-webpack-plugin' );
const baseDir = join( __dirname, '../../' );
const PACKAGES_PATH = 'packages/packages';
/**
* Given a string, returns a new string with dash separators converedd to
@ -160,7 +159,7 @@ module.exports = function( env = { environment: 'production', watch: false } ) {
let vendorCopies = mode === "development" ? developmentCopies : [ ...minifiedCopies, ...minifyCopies ];
let cssCopies = packages.map( ( packageName ) => ( {
from: join( baseDir, PACKAGES_PATH, `${ packageName }/build-style/*.css` ),
from: join( baseDir, `node_modules/@wordpress/${ packageName }/build-style/*.css` ),
to: join( baseDir, `${ buildTarget }/css/dist/${ packageName }/` ),
flatten: true,
transform: ( content ) => {
@ -179,7 +178,7 @@ module.exports = function( env = { environment: 'production', watch: false } ) {
} ) );
const phpCopies = Object.keys( phpFiles ).map( ( filename ) => ( {
from: join( baseDir, PACKAGES_PATH, filename ),
from: join( baseDir, `node_modules/@wordpress/${ filename }` ),
to: join( baseDir, `src/${ phpFiles[ filename ] }` ),
} ) );
@ -188,7 +187,7 @@ module.exports = function( env = { environment: 'production', watch: false } ) {
entry: packages.reduce( ( memo, packageName ) => {
const name = camelCaseDash( packageName );
memo[ name ] = join( baseDir, PACKAGES_PATH, packageName );
memo[ name ] = join( baseDir, `node_modules/@wordpress/${ packageName }` );
return memo;
}, {} ),
output: {