Commit Graph

28 Commits

Author SHA1 Message Date
desrosj
ae378d5095 Build/Test Tools: Update npm dependencies.
This updates the following npm dependencies to their latest versions:

- `chalk` from `5.1.0` to `5.2.0`.
- `dotenv-expand` from `9.0.0` to `10.0.0`.
- `grunt-contrib-qunit` from `6.2.0` to `6.2.1`.
- `prettier` from `2.0.5` to `2.6.2`.
- `qunit` from `2.19.1` to `2.19.4`.
- `sass` from `1.55.0` to `1.58.0`.
- `sinon` from `14.0.1` to `15.0.1`.
- `sinon-test` from `3.1.4` to `3.1.5`.
- `source-map-loader` from `4.0.0` to `4.0.1`.
- `uglify-js` from `3.17.3` to `3.17.4`.
- `wait-on` from `6.0.1` to `7.0.1`.
- `webpack` from `5.74.0` to `5.75.0`.

Additionally, `npm audit fix` has been run to further update packages that may contain vulnerabilities.

Props naeemhaque, mukesh27, desrosj.
See #57535.
Built from https://develop.svn.wordpress.org/trunk@55191


git-svn-id: http://core.svn.wordpress.org/trunk@54724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-02 16:36:32 +00:00
desrosj
e4a97cc8e9 Build/Test Tools: Update NPM dependencies to their latest versions.
The following dependencies are being updated:

- `copy-webpack-plugin` from `10.2.4` to `11.0.0`.
- `dotenv` from `16.0.1` to `16.0.2`.
- `dotenv-expand` from `8.0.3` to `9.0.0`.
- `sass` from `1.53.0` to `1.55.0`.
- `sinon-test` from `3.1.3` to `3.1.4`.
- `source-map-loader` from `3.0.1` to `4.0.0`.
- `terser-webpack-plugin` from `5.3.1` to `5.3.6`.
- `uglify-js` from `3.16.1` to `3.17.1`.
- `uuid` from `8.3.2` to `9.0.0`.
- `webpack` from `5.72.0` to `5.74.0`.

This also contains changes after running `npm audit fix`.

Fixes #56641.
Built from https://develop.svn.wordpress.org/trunk@54296


git-svn-id: http://core.svn.wordpress.org/trunk@53855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-23 19:55:30 +00:00
desrosj
f27c6a5565 Build/Test Tools: Update some NPM dependencies to the latest versions.
This updates several NPM dependencies to the latest versions, including:

- `check-node-version` from `4.1.0` to `4.2.1`.
- `dotenv` from `10.0.0` to `16.0.0`.
- `dotenv-expand` from `5.1.0` to `8.0.3`.
- `grunt-contrib-concat` from `2.0.0` to `2.1.0`.
- `grunt-contrib-jshint` from `3.1.1` to `3.2.0`.
- `grunt-contrib-uglify` from `5.0.1` to `5.1.0`.
- `qunit` from `2.17.2` to `2.18.1`.
- `sass` from `1.43.4` to `1.50.0`.
- `sinon` from `12.0.1` to `13.0.1`.
- `sinon-test` from `3.1.1` to `3.1.3`.
- `uglify-js` from `3.14.3` to `3.15.3`.
- `wait-on` from `6.0.0` to `6.0.1`.

The updates to `dotenv` and `dotenv-expand` required a minor change to files using these packages.

Additionally, this contains several updates to the `package-lock.json` file as a result of running `npm audit fix`.

See #54727.
Built from https://develop.svn.wordpress.org/trunk@53113


git-svn-id: http://core.svn.wordpress.org/trunk@52702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 20:07:18 +00:00
joedolson
a3a61c5a3e General: Remove role="navigation" from nav elements.
Role="navigation" was required for assistive technology to recognize HTML5 element's native ARIA roles while HTML5 and ARIA were being introduced. With the deprecation of IE11, the role attribute is only required when mapping elements that don't have native role.

Props costdev, mukesh27.
Fixes #54054.
Built from https://develop.svn.wordpress.org/trunk@51967


git-svn-id: http://core.svn.wordpress.org/trunk@51556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 21:47:13 +00:00
desrosj
235b19b3b0 Build/Test Tools: Update some devDependencies.
This updates a handful of dependencies to their latest versions.

- `qunit` from `2.14.0` to `2.14.1`.
- `uglify-js` from `3.13.0` to `3.13.1`.
- `wait-on` from `5.2.1` to `5.3.0`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50545


git-svn-id: http://core.svn.wordpress.org/trunk@50158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 17:48:23 +00:00
desrosj
bbdc16d705 Build/Test Tools: Update some dependencies.
This updates the following `devDependencies`:

- `grunt-contrib-cssmin` from `3.0.0` to `4.0.0`.
- `uglify-js` from `3.12.8` to `3.13.0`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50487


git-svn-id: http://core.svn.wordpress.org/trunk@50100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-03 21:16:22 +00:00
desrosj
ebeaae9de0 Build/Test Tools: Update the uglify-js package.
This updates the `uglify-js` package from version `3.12.4` to `3.12.5`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49989


git-svn-id: http://core.svn.wordpress.org/trunk@49690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 13:35:18 +00:00
desrosj
05f174acf6 Build/Test Tools: Update UglifyJS to the latest version.
This updates the `uglify-js` package from version `3.6.0` to `3.12.4`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49940


git-svn-id: http://core.svn.wordpress.org/trunk@49639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-06 15:29:24 +00:00
Adam Silverstein
b8d1d01cc5 REST API: JS Client - improve collection route construction for empty parents.
Fix an issue where the constructed path for hierarchical collections could contain a double slash ("//") when items contained empty parents, causing an error.

Props nicomollet.
Fixes #44745.

Built from https://develop.svn.wordpress.org/trunk@49390


git-svn-id: http://core.svn.wordpress.org/trunk@49149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:32:05 +00:00
Sergey Biryukov
49007e52bc Build/Test Tools: Add banner to RTL CSS and minified JS files.
Patches occasionally come in on generated files. We should be kind to new contributors and give them a hint that these files are auto-generated.

This is a follow-up to [41271], which added the banner to minified CSS files.

Fixes #48424. See #30666.
Built from https://develop.svn.wordpress.org/trunk@46589


git-svn-id: http://core.svn.wordpress.org/trunk@46386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-26 00:17:07 +00:00
Aaron Jorbin
0e21d32900 Build/Test: Bump devDependencies for WordPress 5.3
This upgrades a number of devDependencies.  Some of these include changes to how the tasks are configured.

Uglify: There are deprecated options from 2.x to 4.x, see: https://github.com/gruntjs/grunt-contrib-uglify#options

Autoprefixer: Browserslist now warns when passing in the browser list, so that is put into package.json

As with most changes to uglify, this changes every minified JS file.

Fixes #48203.



Built from https://develop.svn.wordpress.org/trunk@46408


git-svn-id: http://core.svn.wordpress.org/trunk@46206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-05 19:49:10 +00:00
K. Adam White
b5ec1e6d96 REST API: generate a valid fallback URI in wp.api.utils.getRootURL.
When window.location.origin isn't set, correctly insert two slashes between the protocol and host when constructing the fallback URL.

props abdullahramzan.
Fixes #44764.

Built from https://develop.svn.wordpress.org/trunk@43566


git-svn-id: http://core.svn.wordpress.org/trunk@43395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-11 18:51:24 +00:00
Dominik Schilling
6fd9d2edcf REST API JavaScript Client: Support an empty string for nonce to disable sending the X-WP-Nonce header.
Passing a `nonce` argument with an empty string to `wp.api.init()` now does no longer fall back to `wpApiSettings.nonce`. This makes it possible to stop sending nonce headers, for example to a read-only endpoint on another site in a multisite install.

Props adamsilverstein, FPCSJames, ocean90, swissspidy.
Fixes #42948, #43266.
Built from https://develop.svn.wordpress.org/trunk@42852


git-svn-id: http://core.svn.wordpress.org/trunk@42682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-18 17:21:30 +00:00
Dominik Schilling
3138d89e1e REST API JS Client: Extend custom nonce functionality to collections.
This brings the improved nonce handling from [41553] to collections to remove the direct `wpApiSettings.nonce` dependency.

Props adamsilverstein, ocean90, swissspidy.
Fixes #43265.
Built from https://develop.svn.wordpress.org/trunk@42851


git-svn-id: http://core.svn.wordpress.org/trunk@42681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-18 17:04:30 +00:00
Adam Silverstein
274792f9cd REST API: JS client - Enumerate endpoints supporting trash.
Improve the logic determining which endpoints support the trash by enumerating them. Endpoints that don't support the trash require `force=true` when deleting. The previous approach relied on the `force` argument description, which is a translated string and was fragile. In the future, we can expose whether an endpoint supports the trash as part of its schema and automate this logic.

Props Soean.
Fixes #40672.


Built from https://develop.svn.wordpress.org/trunk@42047


git-svn-id: http://core.svn.wordpress.org/trunk@41881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-31 02:54:48 +00:00
Adam Silverstein
5087d26d2d WP-API JS Client: Improve support for meta.
* Add/fix `getMeta`, `getMetas`, `setMeta` and `setMetas` helpers for models that support meta.
* Add tests for new helpers, verify meta support for `Posts`, `Comments`, `Tags` and `Users`.
* Include meta data in fixture generation and fixture file driving tests.

Fixes #41055.

Built from https://develop.svn.wordpress.org/trunk@41678


git-svn-id: http://core.svn.wordpress.org/trunk@41512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:41:35 +00:00
Adam Silverstein
e23b4e9269 REST API JavaScript Client: improve support for model deletion/trash.
Update the way and location the JavaScript client determines which models/endpoints require the `force=true` parameter when being deleted to avoid a `rest_trash_not_supported` error. Identify models with endpoints that support DELETE, excluding those that support the trash (posts and pages by default). Also, move the check into the default `wp.api.WPApiBaseModel.initialize()` function.

Props caercam, euthelup.
Fixes #40672.


Built from https://develop.svn.wordpress.org/trunk@41657


git-svn-id: http://core.svn.wordpress.org/trunk@41491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 13:07:45 +00:00
Adam Silverstein
639d215300 REST API JS Client: Improve nonce handling, refresh stale nonce on sync.
Keep the nonce used for cookie based authentication fresh by pulling in and using any new nonce supplied in the response headers.

* Enable passing nonce to init so each api/endpoint can use a unique nonce.
* Store nonce for endpoint on endpointModel.
* New model helper `nonce()` retrieves a model's routeModel nonce.
* When a response header contains a nonce that doesn't match the stored nonce, replace it.

Fixes #40422.

Built from https://develop.svn.wordpress.org/trunk@41553


git-svn-id: http://core.svn.wordpress.org/trunk@41386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 12:58:45 +00:00
Adam Silverstein
ba0970ab28 WP-API JS Client: Add helpers to get a model or collection by route.
Add two new helper functions, `wp.api.getModelByRoute` and `wp.api.getCollectionByRoute`. Passed a route, they return the matching model or collection, or `undefined` if none is found.

Also adds tests to verify these functions work as expected.

Props rcutmore.
Fixes #41111.

Built from https://develop.svn.wordpress.org/trunk@41334


git-svn-id: http://core.svn.wordpress.org/trunk@41165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-04 16:01:43 +00:00
K. Adam White
6aaba32b36 WP-API JS Client: Interpret Settings resource as a model.
The REST API does not provide a mechanism to distinguish between endpoints representing models and those representing collections, so the Backbone client must make that distinction internally. Previously wp-api.js accounted for `/users/me`, but not for `/settings`. This patch updates the logic so that `/settings` is properly registered as a Backbone model.

When calling `wp.api.init`, additional endpoints can be specified to be models using the `modelEndpoints` argument.

Props @adamsilverstein.
Fixes #41056.

Built from https://develop.svn.wordpress.org/trunk@41112


git-svn-id: http://core.svn.wordpress.org/trunk@40952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-20 20:26:45 +00:00
Adam Silverstein
789f141045 REST API: JS Client - Enable connecting to multiple endpoints.
Enable connecting to multiple wp-api `endpoints`. Calling `wp.api.init` with a new `apiRoot` will parse the new endpoint's schema and store a new set of models and collections. A collection of connected endpoints is stored in `wp.api.endpoints`.

Props lucasstark.
Fixes #39683.


Built from https://develop.svn.wordpress.org/trunk@40364


git-svn-id: http://core.svn.wordpress.org/trunk@40271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-02 19:41:41 +00:00
Adam Silverstein
518ff1576b REST API: JavaScript client - improve route discovery for custom namespaces.
Fix parsing of custom namespace routes. Transform class names, removing dashes and capitalizing each word/route part so a route path of `widgets/recent-posts` becomes a collection with the name `WidgetsRecentPosts`. Correct parent route part when routes are longer than expected, reversing parse direction.

Props westonruter, jazbek.
Fixes #39561.

Built from https://develop.svn.wordpress.org/trunk@40074


git-svn-id: http://core.svn.wordpress.org/trunk@40011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 20:54:44 +00:00
Adam Silverstein
717aeab3cc REST API: JavaScript client should use _.extend when merging objects.
Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects.

Props ketuchetan.
Fixes #39341.


Built from https://develop.svn.wordpress.org/trunk@40040


git-svn-id: http://core.svn.wordpress.org/trunk@39977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-03 21:46:43 +00:00
Adam Silverstein
c8a3496ebe REST API: Add error handling for fetch error in buildModelGetter of wp-api.js.
When a call to a model getter method fails, reject the returned deferred object. Enables better handling of fetch errors.

Props westonruter, adamsilverstein.
Fixes #39314.

Built from https://develop.svn.wordpress.org/trunk@39680


git-svn-id: http://core.svn.wordpress.org/trunk@39620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 03:03:42 +00:00
Adam Silverstein
bc7a03a33b WP-API: JavaScript client - fix setup of models used by wp.api.collections objects.
Correct setup for the `model` attribute of `wp.api.collections` objects. Set the collection model as a function that returns a new model of the underlying type, instead of setting it as the model prototype. Fixes an issue where models for fetched collections weren't set up properly and didn't have the expected mixin methods such as `getCategories` available.

Props jesseenterprises.
Fixes #39070.

Built from https://develop.svn.wordpress.org/trunk@39603


git-svn-id: http://core.svn.wordpress.org/trunk@39543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-15 12:54:42 +00:00
Joe Hoyle
e20ded7e75 REST API: Make JS Client store schema in session storage.
Props adamsilverstein.
Fixes #38895.
Built from https://develop.svn.wordpress.org/trunk@39344


git-svn-id: http://core.svn.wordpress.org/trunk@39284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-23 02:55:30 +00:00
Aaron Jorbin
32be6f7bb7 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.


Built from https://develop.svn.wordpress.org/trunk@39117


git-svn-id: http://core.svn.wordpress.org/trunk@39059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:40:34 +00:00
Rachel Baker
e4a7c0a397 REST API: Introduce the Content API endpoints.
REST API endpoints for your WordPress content. These endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, allowing new and innovative apps for interacting with your site. These endpoints support all of the following:
- Posts: Read and write access to all post data, for all types of post-based data, including pages and media.
- Comments: Read and write access to all comment data. This includes pingbacks and trackbacks.
- Terms: Read and write access to all term data.
- Users: Read and write access to all user data. This includes public access to some data for post authors.
- Meta: Read and write access to metadata for posts, comments, terms, and users, on an opt-in basis from plugins.
- Settings: Read and write access to settings, on an opt-in basis from plugins and core. This enables API management of key site content values that are technically stored in options, such as site title and byline.

Love your REST API, WordPress!  The infrastructure says, "Let's do lunch!" but the content API endpoints say, "You're paying!"

Props rmccue, rachelbaker, danielbachhuber, joehoyle, adamsilverstein, afurculita, ahmadawais, airesvsg, alisspers, antisilent, apokalyptik, artoliukkonen, attitude, boonebgorges, bradyvercher, brianhogg, caseypatrickdriscoll, chopinbach, chredd, christianesperar, chrisvanpatten, claudiolabarbera, claudiosmweb, cmmarslender, codebykat, coderkevin, codfish, codonnell822, daggerhart, danielpunkass, davidbhayes, delphinus, desrosj, dimadin, dotancohen, DrewAPicture, Dudo1985, duncanjbrown, eherman24, eivhyl, eliorivero, elyobo, en-alis, ericandrewlewis, ericpedia, evansobkowicz, fjarrett, frozzare, georgestephanis, greatislander, guavaworks, hideokamoto, hkdobrev, hubdotcom, hurtige, iandunn, ircrash, ironpaperweight, iseulde, Japh, jaredcobb, JDGrimes, jdolan, jdoubleu, jeremyfelt, jimt, jjeaton, jmusal, jnylen0, johanmynhardt, johnbillion, jonathanbardo, jorbin, joshkadis, JPry, jshreve, jtsternberg, JustinSainton, kacperszurek, kadamwhite, kalenjohnson, kellbot, kjbenk, kokarn, krogsgard, kuchenundkakao, kuldipem, kwight, lgedeon, lukepettway, mantismamita, markoheijnen, matrixik, mattheu, mauteri, maxcutler, mayukojpn, michael-arestad, miyauchi, mjbanks, modemlooper, mrbobbybryant, NateWr, nathanrice, netweb, NikV, nullvariable, oskosk, oso96_2000, oxymoron, pcfreak30, pento, peterwilsoncc, Pezzab, phh, pippinsplugins, pjgalbraith, pkevan, pollyplummer, pushred, quasel, QWp6t, schlessera, schrapel, Shelob9, shprink, simonlampen, Soean, solal, tapsboy, tfrommen, tharsheblows, thenbrent, tierra, tlovett1, tnegri, tobych, Toddses, toro_unit, traversal, vanillalounge, vishalkakadiya, wanecek, web2style, webbgaraget, websupporter, westonruter, whyisjake, wonderboymusic, wpsmith, xknown, zyphonic.
Fixes #38373.
Built from https://develop.svn.wordpress.org/trunk@38832


git-svn-id: http://core.svn.wordpress.org/trunk@38775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 02:55:32 +00:00