Commit Graph

125 Commits

Author SHA1 Message Date
Adam Silverstein e3d5e1c6c8 REST API: improve test fixture generation, normalizing data.
Add a data normalization pass when generating data fixtures for the REST API endpoints. Ensures that the `wp-api-generated.js` fixture won't change between test runs. Set more default properties and use fixed values for any properties that can't be easily controlled (object IDs and derivatives like link). Generate the fixture file with JSON_PRETTY_PRINT so that future diffs are easier to follow.

Props jnylen0, netweb.
Fixes #39264.


git-svn-id: https://develop.svn.wordpress.org/trunk@40061 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-15 17:58:14 +00:00
Adam Silverstein 1879140548 REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.

The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.

Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.

Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.

Props jnylen0, welcher.
Fixes #39264.



git-svn-id: https://develop.svn.wordpress.org/trunk@40058 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 04:22:32 +00:00
Aaron Jorbin 8b464c7140 Build/Test tools: Add "apply" as alias for "patch"
The command applies a patch, so apply makes just as much sense. Additionally, this is to help translate dev tools into Australian.

Props netweb.
Fixes #38724.


git-svn-id: https://develop.svn.wordpress.org/trunk@39195 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-10 03:21:39 +00:00
Aaron Jorbin 2c0e24babf Bump grunt-contrib-uglify from 1.0.1 to 2.0.0
Sets `screwIE8` to false as it is now enabled by default

Files Changed:
build/wp-admin/js/customize-nav-menus.min.js
build/wp-admin/js/customize-widgets.min.js
build/wp-includes/js/customize-loader.min.js

Changelog:
2016-07-19   v2.0.0   Update uglify-js to v2.7.0. screwIE8 is enabled by default.
2016-07-19   v1.0.2   Update grunt to ^1.0.0. Fix beautify when passed as an object. Fix docs about report values.

See #38199.



git-svn-id: https://develop.svn.wordpress.org/trunk@39117 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:39:10 +00:00
Aaron Jorbin ce21d8210a Build/Test Tools: Allow Minimal Builds
Builds can hang or get very slow on copy when you have alot of files. Alot of files can suddenly appear when you are developing new themes or plugins. Often, it's nice to have a minimal build, especially if you are preparing a commit.

This adds a new flag `--minimal-copy` that can be added to any task which does a copy. These tasks include build, test, and copy. This flag will cause no plugins to be copied and only the twenty series of default themes to be copied. Everything else remains the same.

Fixes #38423.


git-svn-id: https://develop.svn.wordpress.org/trunk@38848 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-20 22:23:21 +00:00
John Blackbourn 29cfd0b336 oEmbed: Remove the oEmbed provider unit tests.
This reverts [38454] along with its follow-up commits, [38512], [38514], and [38692]. These tests are currently not pass
ing, and maybe they never will. The tests are in a group which does not run by default without a flag, making them quest
ionably useful.

We can re-visit this at a later date.

See #32360


git-svn-id: https://develop.svn.wordpress.org/trunk@38840 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-20 09:15:10 +00:00
Gary Pendergast c19e66bf87 Build: Ignore JSHint errors in Twenty Seventeen's third party libraries.
`html5.js` and `jquery.scrollTo.js` are external libraries, so don't need to be checked by JSHint.

Props kadamwhite.
Fixes #38376.



git-svn-id: https://develop.svn.wordpress.org/trunk@38836 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-20 05:43:09 +00:00
Scott Taylor 7ca480cc4e OEmbed: add unit tests. `@group external-oembed` is not run by default.
Props johnbillion, wonderboymusic.
See #32360.


git-svn-id: https://develop.svn.wordpress.org/trunk@38454 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-30 18:54:53 +00:00
Aaron Jorbin 1774eb80e6 Fix jshint of Gruntfile.js
Introduced in [38276]

See #37720.


git-svn-id: https://develop.svn.wordpress.org/trunk@38281 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 20:04:16 +00:00
Aaron Jorbin e1590fff09 External Libraries: Update Minified version of jquery.masonry.js
WordPress maintains the minified version of jquery.masonry.js since there is no official build, however it has been excluded from grunt's minification process. This adds a minification task to grunt, adds it to the precommit hook for JS, minifies the file, and bumps the version on jquery.masonry.min.js. The change to the non minified version was introduced in [38261].

Fixes #37720.  See #37666.


git-svn-id: https://develop.svn.wordpress.org/trunk@38276 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 18:54:41 +00:00
Andrew Ozz 7e53f5e404 Grunt: when running `precommit` use regex to check which files have been modified.
Fixes #36528.

git-svn-id: https://develop.svn.wordpress.org/trunk@37749 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-19 12:31:15 +00:00
Aaron Jorbin 8ad4a72960 Build/Test Tools: Run prerelease as the precommit task for configuration file changes
Whenever package.json or Gruntfile.js is updated, we should assume that it affects everything and run the full monty of tasks.

Fixes #36528.
Props iseulde.



git-svn-id: https://develop.svn.wordpress.org/trunk@37650 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-07 03:32:22 +00:00
Ella Iseulde Van Dorpe f261cb7914 Build/Test Tools: Run image tasks only if there are changes
See #36528.


git-svn-id: https://develop.svn.wordpress.org/trunk@37211 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-15 10:18:03 +00:00
Sergey Biryukov 1694407e0d Build Tools: Don't run the `build` task twice in `grunt prerelease` (it already runs via the `precommit:js` task).
Props netweb.
Fixes #36489.

git-svn-id: https://develop.svn.wordpress.org/trunk@37206 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-14 15:38:40 +00:00
Ella Iseulde Van Dorpe f0bc007421 Build/Test Tools: Better git/svn detection
Prevent tasks from running twice in parallel 
if both .svn and .git directories are present.

Add `--ignore-externals` to `svn status`
and replace `git diff --name-only` with `git status --short`.

Merge some duplicate code.

Fixes #36394.
See #35557.
See [36906].



git-svn-id: https://develop.svn.wordpress.org/trunk@37185 602fd350-edb4-49c9-b593-d223f7449a82
2016-04-12 22:33:18 +00:00
ocean90 72f82072d4 Build Tools: Rename the `precommit:core` task to `precommit:base` for clarification.
`precommit:base` runs only the `imagemin:core` task.

Fixes #35557.

git-svn-id: https://develop.svn.wordpress.org/trunk@36955 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-10 20:13:29 +00:00
Dominik Schilling (ocean90) 307f8d8558 Build Tools: Update grunt-rtlcss ~1.6.0 → ~2.0.1.
This updates the underlying RTLCSS framework to 2.0 which provides new options and config settings, see https://github.com/MohammadYounes/rtlcss/blob/master/CHANGELOG.md#200---18-feb-2016.

See #35104.

Build: https://build.trac.wordpress.org/changeset/36903

git-svn-id: https://develop.svn.wordpress.org/trunk@36935 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-10 16:00:11 +00:00
Aaron Jorbin 6abfb7a92a Add grunt prerelease task
An unintended consequence of improving the precommit task is that when it's time to run a release, more tasks need to get run to verify things. This adds a prerelease task to help fix that situation. grunt prerelease should include tasks that verify the code base is ready to be released to the wild and find all the tears on the mausoleum floor and help Blood stain the Colosseum doors.

See #35557


git-svn-id: https://develop.svn.wordpress.org/trunk@36930 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-10 05:36:15 +00:00
Boone Gorges 47dd0e3471 Increase beautificatedness of language in `grunt precommit` unit test messages.
Comma splices are bad, we should remove them from the codebase.

See #35557.

git-svn-id: https://develop.svn.wordpress.org/trunk@36924 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-10 03:01:06 +00:00
Aaron Jorbin 81652abd8b Improve grunt precommit task
Instead of running all tasks, all the time, let's run tasks based on the files changed. PHPUNIT is now a precommit task for all php file changes. 

This adds a new dependency. Please run `npm install`.

Fixes #35557
Props  ericlewis, netweb, jorbin



git-svn-id: https://develop.svn.wordpress.org/trunk@36906 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-09 20:54:10 +00:00
Dominik Schilling (ocean90) 5f808bd8fc Media: Add support for minified versions of wp-playlist.js, wp-mediaelement.js and wp-mediaelement.css.
Fixes #35984.

git-svn-id: https://develop.svn.wordpress.org/trunk@36780 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-29 20:42:10 +00:00
Dion Hulse 078b93863d Build Tools: Revert to using a human readable timestamp rather than the unix timestamp in [36315].
Fixes #28722


git-svn-id: https://develop.svn.wordpress.org/trunk@36351 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 02:01:57 +00:00
Dion Hulse 834ba4367f CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`.
We still generate the `wp-admin.*` files for compabitility purposes, however they only include the `@import()` lines.

Fixes #35229


git-svn-id: https://develop.svn.wordpress.org/trunk@36341 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-18 09:56:06 +00:00
Pascal Birchler 8e8cdb2ef4 Build Tools: Append the timestamp to `$wp_version` instead of only the current date.
This ensures the `Etag` header added in [36312] changes for every build.

Fixes #28722.

git-svn-id: https://develop.svn.wordpress.org/trunk@36315 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 11:53:29 +00:00
Dominik Schilling (ocean90) ee3ac55419 Build: Update source for `includes:embed` after [35718].
See #33413.

git-svn-id: https://develop.svn.wordpress.org/trunk@35720 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-20 15:36:21 +00:00
Gary Pendergast c7e05dafbe Embeds: Remove `&` characters from the inline embed JS.
Older versions of WordPress will convert those `&` characters to `&`, which makes for some non-functional JS. If folks are running an older release, let's not make their lives more difficult than it already is.

Props pento, peterwilsoncc.

See #34698.



git-svn-id: https://develop.svn.wordpress.org/trunk@35708 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-19 23:05:39 +00:00
Aaron Jorbin 76da6cf987 Set cssmin compatibility to ie7
This matches the autoprefixer setting. This changes all compiled CSS.

Fixes #34540.
Props christophherr, peterwilsoncc, netweb



git-svn-id: https://develop.svn.wordpress.org/trunk@35684 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-18 20:27:45 +00:00
Dominik Schilling (ocean90) ca3e473b47 Build Tools: Update the `preserveComments` option for `uglify:jqueryui`.
Uglify2 doesn't support the value "some" anymore. Replace it with the `/^!/` regex which produces the same output as before.

See https://build.trac.wordpress.org/changeset/35502 and https://build.trac.wordpress.org/changeset/35528.
Fixes #34177.

git-svn-id: https://develop.svn.wordpress.org/trunk@35564 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-07 12:36:24 +00:00
Sergey Biryukov 88d63f743e Build Tools: Add Microsoft Edge to Autoprefixer options.
Props christophherr.
Fixes #34550.

git-svn-id: https://develop.svn.wordpress.org/trunk@35488 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-02 20:43:55 +00:00
Gary Pendergast 47e6c78d88 Embeds: Add fallbacks for IE7-9.
Older IE versions need just that little bit of extra tender care to keep them going.

Props peterwilsoncc, swissspidy, pento.

Fixes #34204.



git-svn-id: https://develop.svn.wordpress.org/trunk@35466 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-31 04:37:41 +00:00
Aaron Jorbin 8f2e001efe Replace Autoprefixer Core with Autoprefixer
Autoprefixer Core 5.2.1 -> Autoprefixer 6.0.3 https://github.com/postcss/autoprefixer/releases/tag/6.0.0
Package autoprefixer-core is deprecated in favour of autoprefixer as part of the 6.0.0 release:
Packages autoprefixer and autoprefixer-core were merged in 6.0 release.
Autoprefixer 6.0.0 requires PostCSS 5.0.10 or greater
PostCSS 0.5.4 -> 0.6.0 https://github.com/nDmitry/grunt-postcss/compare/v0.5.4...v0.6.0

You will need to update your dev dependencies after this change.

Props netweb
See #34177



git-svn-id: https://develop.svn.wordpress.org/trunk@35332 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-21 16:47:21 +00:00
Sergey Biryukov 9b591d6b09 Embeds: Rename files, functions, and hooks added in [34903] to make it more clear what is oEmbed-specific and what isn't.
See https://core.trac.wordpress.org/ticket/34272#comment:7 for full list of renamed functions and hooks.

Props swissspidy.
Fixes #34272.

git-svn-id: https://develop.svn.wordpress.org/trunk@35235 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-17 01:20:19 +00:00
Sergey Biryukov 5b6257083d Twenty Sixteen: Update `Gruntfile.js` to ignore the html5 shiv for JSHint.
See #34306, #34315.

git-svn-id: https://develop.svn.wordpress.org/trunk@35203 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-15 17:26:44 +00:00
Gary Pendergast 46fbcc96fd Build: Fix a filename typo in [34903].
Props peterwilsoncc.

See #32522.



git-svn-id: https://develop.svn.wordpress.org/trunk@34906 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 12:04:39 +00:00
Gary Pendergast 43bd3d46c9 Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.

In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.

For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.

Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia

Fixes #32522.



git-svn-id: https://develop.svn.wordpress.org/trunk@34903 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 10:35:18 +00:00
Scott Taylor bec5838166 Build Tools: upgrade `grunt-browserify` to `~4.0.0` and remove the `watch` task for `browserify`, which has its own internal watcher. Run `npm install` to update.
Props iseulde.
Fixes #31911.


git-svn-id: https://develop.svn.wordpress.org/trunk@34888 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 00:00:00 +00:00
Scott Taylor 16312b141b Speed up `browserify` builds, don't `uglify` the media builds on `watch`.
Props iseulde.
Fixes #31911.


git-svn-id: https://develop.svn.wordpress.org/trunk@33960 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-09 02:11:23 +00:00
Scott Taylor 220ba402e5 Pre-req for Media builds: make sure the watcher actually works for `browserify`.
See #31911.


git-svn-id: https://develop.svn.wordpress.org/trunk@33959 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-09 02:02:14 +00:00
Ella Iseulde Van Dorpe 129a3affe5 Editor: word count: exclude more characters
Also only exclude these characters for the `words` type. They should be counted for other types.
Add the ASCIIOnly option to the uglify config to preserve escaped unicode characters.

See #30966. Fixes #27391.



git-svn-id: https://develop.svn.wordpress.org/trunk@33292 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-16 09:44:43 +00:00
Aaron Jorbin f86fd644e1 Remove grunt-autoprefixer in favor of grunt-postcss with autoprefixer
grunt-autoprefixer was deprecated - e020f878d5
None of the autoprefixer tasks should have been called directly, so they are now removed.  `grunt precommit` and `grunt build` still work exactly as they should.  This change doesn't affect the output of our builds.

An NPM install is required after you have updated after this change.

See #31700
Props netweb



git-svn-id: https://develop.svn.wordpress.org/trunk@33129 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-08 19:53:22 +00:00
Dominik Schilling (ocean90) c0a66eba79 Add menu management to the Customizer.
This brings in the Menu Customizer plugin: https://wordpress.org/plugins/menu-customizer/.

props celloexpressions, westonruter, valendesigns, voldemortensen, ocean90, adamsilverstein, kucrut, jorbin, designsimply, afercia, davidakennedy, obenland.
see #32576.

git-svn-id: https://develop.svn.wordpress.org/trunk@32806 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 22:07:08 +00:00
Ella Iseulde Van Dorpe 66f327cff2 QUnit: test minified files
Fixes #32574.


git-svn-id: https://develop.svn.wordpress.org/trunk@32698 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-06 19:57:54 +00:00
Scott Taylor 91143924cd Move the built media JS files up a directory to their previous location and naming convention. This fidgets with part of [31373] and will maintain BC for those who were loading those files directly (not using the enqueue system).
Props iseulde, ocean90.
Fixes #31912.


git-svn-id: https://develop.svn.wordpress.org/trunk@32125 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-14 15:30:16 +00:00
Aaron Jorbin e2d5237851 Don't override minified libraries included in core
A number of libraries that we include in core come with minified versions that we also include in core. The build process shouldn't override them.

Fixes #31477
Props ocean90, jorbin



git-svn-id: https://develop.svn.wordpress.org/trunk@32066 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-07 04:37:24 +00:00
Gary Pendergast 5a0564bb8f Emoji: Instead of loading the emoji JS files automatically, we now include a small JS shim in the header, to test if the user's browser needs Twemoji. It then loads the emoji JS files only if they're needed.
Props pento, azaozz.

Fixes #31701.



git-svn-id: https://develop.svn.wordpress.org/trunk@31875 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-24 23:32:23 +00:00
azaozz e35b6490a3 Press This: exclude both bookmarklet.js and bookmarklet.min.js from the main uglify task. Props stephdau. Fixes #31657.
git-svn-id: https://develop.svn.wordpress.org/trunk@31796 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-16 20:36:02 +00:00
Andrew Ozz 71aa99360e PressThis: in Grunt, minify the bookmarklet before copying the files to /build.
See #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31774 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-13 21:08:14 +00:00
Gary Pendergast 37bee1ed3a Emoji: Instead of having custom hooks for Ajax callbacks, use MutationObserver to re-parse any changed elements in the DOM.
Props iseulde

See #31242



git-svn-id: https://develop.svn.wordpress.org/trunk@31750 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-12 12:51:06 +00:00
Scott Taylor 06a86d1425 Use `browserify`'s watch mechanism in tandem with `grunt watch`. Makes building media bundles about 10 (million) times faster.
Make the `browserify` config more dynamic to make future additions easier and to ensure proper use of `SOURCE_DIR`.

Props iseulde, wonderboymusic.
See #28510.


git-svn-id: https://develop.svn.wordpress.org/trunk@31629 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 19:48:59 +00:00
Dominik Schilling (ocean90) 4e7a4deca6 Build: Let RTLCSS handle swapping the codes for right/left arrows from Dashicons.
Exclude `wp-includes/css/dashicons.css` from core task since we don't want/need a RTL version of it.

fixes #31478.

git-svn-id: https://develop.svn.wordpress.org/trunk@31579 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-27 20:18:05 +00:00