From 6cfeadc0d3a5361307877b095fdb981335dac4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Tue, 5 Nov 2024 15:06:35 +0100 Subject: [PATCH] Tools: Enforce the same order of fields in `package.json` files (#66239) * Update package managing flow * Adapt packages webpack config for workspaces * Ignore "dev" scripts this should be done another way * Annotate packages included as WordPress scripts * Do not annotate react-native packages * Update packages webpack to use wpScript package.json * Implement Gutenberg specific check-licenses script * Remove redundant entries from the ignore list * Update some docs langauge about lerna and npm workspaces * Tools: Enforce the same order of fields in `package.json` files * Update the PR number in the changelog entry * Update packages/npm-package-json-lint-config/index.js Co-authored-by: Jon Surrell * Update CHANGELOG.md * Update the order of properties added recently --------- Co-authored-by: Aki Hamano Co-authored-by: Jon Surrell Co-authored-by: t-hamano Co-authored-by: sirreal Co-authored-by: gziolo --- packages/a11y/package.json | 6 +++--- packages/annotations/package.json | 4 ++-- packages/api-fetch/package.json | 4 ++-- packages/autop/package.json | 4 ++-- packages/blob/package.json | 4 ++-- packages/block-directory/package.json | 4 ++-- packages/block-editor/package.json | 4 ++-- packages/block-library/package.json | 14 +++++++------- .../package.json | 4 ++-- .../block-serialization-spec-parser/package.json | 4 ++-- packages/blocks/package.json | 4 ++-- packages/commands/package.json | 4 ++-- packages/components/package.json | 6 +++--- packages/compose/package.json | 4 ++-- packages/core-commands/package.json | 4 ++-- packages/core-data/package.json | 4 ++-- packages/customize-widgets/package.json | 4 ++-- packages/data-controls/package.json | 4 ++-- packages/data/package.json | 4 ++-- packages/dataviews/package.json | 4 ++-- packages/date/package.json | 4 ++-- packages/deprecated/package.json | 4 ++-- packages/dom-ready/package.json | 4 ++-- packages/dom/package.json | 4 ++-- packages/edit-post/package.json | 4 ++-- packages/edit-site/package.json | 4 ++-- packages/edit-widgets/package.json | 4 ++-- packages/editor/package.json | 4 ++-- packages/element/package.json | 4 ++-- packages/escape-html/package.json | 4 ++-- packages/fields/package.json | 4 ++-- packages/format-library/package.json | 4 ++-- packages/hooks/package.json | 4 ++-- packages/html-entities/package.json | 4 ++-- packages/i18n/package.json | 4 ++-- packages/icons/package.json | 6 +++--- packages/interactivity-router/package.json | 2 +- packages/interactivity/package.json | 2 +- packages/interface/package.json | 4 ++-- packages/is-shallow-equal/package.json | 4 ++-- packages/keyboard-shortcuts/package.json | 4 ++-- packages/keycodes/package.json | 4 ++-- packages/list-reusable-blocks/package.json | 4 ++-- packages/media-utils/package.json | 4 ++-- packages/notices/package.json | 4 ++-- packages/npm-package-json-lint-config/CHANGELOG.md | 4 ++++ packages/npm-package-json-lint-config/index.js | 4 ++++ packages/nux/package.json | 4 ++-- packages/patterns/package.json | 4 ++-- packages/plugins/package.json | 4 ++-- packages/preferences-persistence/package.json | 4 ++-- packages/preferences/package.json | 4 ++-- packages/primitives/package.json | 6 +++--- packages/priority-queue/package.json | 4 ++-- packages/private-apis/package.json | 4 ++-- packages/react-i18n/package.json | 4 ++-- packages/redux-routine/package.json | 4 ++-- packages/reusable-blocks/package.json | 4 ++-- packages/rich-text/package.json | 6 +++--- packages/router/package.json | 4 ++-- packages/server-side-render/package.json | 4 ++-- packages/shortcode/package.json | 4 ++-- packages/style-engine/package.json | 4 ++-- packages/sync/package.json | 4 ++-- packages/token-list/package.json | 4 ++-- packages/undo-manager/package.json | 4 ++-- packages/url/package.json | 4 ++-- packages/viewport/package.json | 4 ++-- packages/vips/package.json | 4 ++-- packages/warning/package.json | 4 ++-- packages/widgets/package.json | 4 ++-- packages/wordcount/package.json | 4 ++-- 72 files changed, 156 insertions(+), 148 deletions(-) diff --git a/packages/a11y/package.json b/packages/a11y/package.json index 09fa62a9d082b7..008bd9088e0778 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -27,8 +27,9 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", - "types": "build-types", + "wpScript": true, "wpScriptModuleExports": "./build-module/module/index.js", + "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/dom-ready": "*", @@ -36,6 +37,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/annotations/package.json b/packages/annotations/package.json index 8a94b326a78194..b1d6d210807a87 100644 --- a/packages/annotations/package.json +++ b/packages/annotations/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/data": "*", @@ -38,6 +39,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/api-fetch/package.json b/packages/api-fetch/package.json index 26f156a0aa7d77..7d5b8dfd588897 100644 --- a/packages/api-fetch/package.json +++ b/packages/api-fetch/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", @@ -34,6 +35,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/autop/package.json b/packages/autop/package.json index 2169ff828da47a..336dda06edfe2c 100644 --- a/packages/autop/package.json +++ b/packages/autop/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -32,6 +33,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/blob/package.json b/packages/blob/package.json index 4b04d2ea2ddebd..0dc01ac7198f59 100644 --- a/packages/blob/package.json +++ b/packages/blob/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -32,6 +33,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/block-directory/package.json b/packages/block-directory/package.json index 59025e1ad45c7a..18a40824aa4754 100644 --- a/packages/block-directory/package.json +++ b/packages/block-directory/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/a11y": "*", @@ -54,6 +55,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/block-editor/package.json b/packages/block-editor/package.json index 2b5cc8d6275e89..26b06474f54b18 100644 --- a/packages/block-editor/package.json +++ b/packages/block-editor/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": [ "build-style/**", "src/**/*.scss", @@ -87,6 +88,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/block-library/package.json b/packages/block-library/package.json index 2c880301c8355d..b196e53e5cd0f9 100644 --- a/packages/block-library/package.json +++ b/packages/block-library/package.json @@ -25,11 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", - "sideEffects": [ - "build-style/**", - "src/**/*.scss", - "{src,build,build-module}/*/init.js" - ], + "wpScript": true, "wpScriptModuleExports": { "./file/view": "./build-module/file/view.js", "./image/view": "./build-module/image/view.js", @@ -37,6 +33,11 @@ "./query/view": "./build-module/query/view.js", "./search/view": "./build-module/search/view.js" }, + "sideEffects": [ + "build-style/**", + "src/**/*.scss", + "{src,build,build-module}/*/init.js" + ], "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/a11y": "*", @@ -88,6 +89,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/block-serialization-default-parser/package.json b/packages/block-serialization-default-parser/package.json index d31ab188c0b6d6..010132ac971db1 100644 --- a/packages/block-serialization-default-parser/package.json +++ b/packages/block-serialization-default-parser/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -33,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/block-serialization-spec-parser/package.json b/packages/block-serialization-spec-parser/package.json index 7cca4a7ca1a68b..d430d2afeebf5a 100644 --- a/packages/block-serialization-spec-parser/package.json +++ b/packages/block-serialization-spec-parser/package.json @@ -25,6 +25,7 @@ "npm": ">=8.19.2" }, "main": "parser.js", + "wpScript": true, "sideEffects": false, "dependencies": { "pegjs": "^0.10.0", @@ -37,6 +38,5 @@ "build": "concurrently \"npm run build:js\" \"npm run build:php\"", "build:js": "pegjs --format commonjs -o ./parser.js ./grammar.pegjs", "build:php": "node bin/create-php-parser.js" - }, - "wpScript": true + } } diff --git a/packages/blocks/package.json b/packages/blocks/package.json index 2d944fe656363b..42890e9b7d56bc 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": [ "{src,build,build-module}/{index.js,store/index.js}" ], @@ -62,6 +63,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/commands/package.json b/packages/commands/package.json index 98eadca595ca86..cebf3237a00d75 100644 --- a/packages/commands/package.json +++ b/packages/commands/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/components": "*", @@ -44,6 +45,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/components/package.json b/packages/components/package.json index faf923ad426bf6..6871511cf5b1e5 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -25,11 +25,12 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, + "types": "build-types", "sideEffects": [ "build-style/**", "src/**/*.scss" ], - "types": "build-types", "dependencies": { "@ariakit/react": "^0.4.10", "@babel/runtime": "7.25.7", @@ -83,6 +84,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/compose/package.json b/packages/compose/package.json index adff24f6663006..68b00b24298d87 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -27,6 +27,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -49,6 +50,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/core-commands/package.json b/packages/core-commands/package.json index ac15b3578cf6ff..db2fb900865c80 100644 --- a/packages/core-commands/package.json +++ b/packages/core-commands/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": false, "dependencies": { "@babel/runtime": "7.25.7", @@ -48,6 +49,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 44ed3aaad5dd3a..a7216e931a70ca 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": [ "{src,build,build-module}/index.js" @@ -60,6 +61,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/customize-widgets/package.json b/packages/customize-widgets/package.json index ef6748f34205e8..41b3a7bd463aa3 100644 --- a/packages/customize-widgets/package.json +++ b/packages/customize-widgets/package.json @@ -23,6 +23,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/block-editor": "*", @@ -55,6 +56,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/data-controls/package.json b/packages/data-controls/package.json index 948efe7fb64022..e4898ff1d0e1ab 100644 --- a/packages/data-controls/package.json +++ b/packages/data-controls/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", @@ -38,6 +39,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/data/package.json b/packages/data/package.json index 0e46b1a366918e..fd1ef7ef4d7489 100644 --- a/packages/data/package.json +++ b/packages/data/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -50,6 +51,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/dataviews/package.json b/packages/dataviews/package.json index 5599a84b92d34c..df30fea1a1c714 100644 --- a/packages/dataviews/package.json +++ b/packages/dataviews/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -47,6 +48,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/date/package.json b/packages/date/package.json index f53c6314912271..d67c1dc527caee 100644 --- a/packages/date/package.json +++ b/packages/date/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", @@ -34,6 +35,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/deprecated/package.json b/packages/deprecated/package.json index 69d2414b0c11a2..64ffc6cd30b251 100644 --- a/packages/deprecated/package.json +++ b/packages/deprecated/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -33,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/dom-ready/package.json b/packages/dom-ready/package.json index 0202229b202842..6e7986c4965dc6 100644 --- a/packages/dom-ready/package.json +++ b/packages/dom-ready/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -32,6 +33,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/dom/package.json b/packages/dom/package.json index 58c572545cc526..97576e9a22e0ff 100644 --- a/packages/dom/package.json +++ b/packages/dom/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -34,6 +35,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/edit-post/package.json b/packages/edit-post/package.json index c594722d180e4f..1b28c1d5f31aa6 100644 --- a/packages/edit-post/package.json +++ b/packages/edit-post/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/a11y": "*", @@ -66,6 +67,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/edit-site/package.json b/packages/edit-site/package.json index 95f9cd5f05742a..67932bcb06321e 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@react-spring/web": "^9.4.5", @@ -82,6 +83,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/edit-widgets/package.json b/packages/edit-widgets/package.json index 0629dca5ec1052..331dbc742dbc8c 100644 --- a/packages/edit-widgets/package.json +++ b/packages/edit-widgets/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/api-fetch": "*", @@ -63,6 +64,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/editor/package.json b/packages/editor/package.json index 61cce478cf08fe..e7b46685719dd4 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": [ "build-style/**", "src/**/*.scss", @@ -85,6 +86,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/element/package.json b/packages/element/package.json index 3004dadb7ea605..4a196255971cfb 100644 --- a/packages/element/package.json +++ b/packages/element/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -40,6 +41,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/escape-html/package.json b/packages/escape-html/package.json index 72863ce15fd8b8..135876460bd05e 100644 --- a/packages/escape-html/package.json +++ b/packages/escape-html/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -32,6 +33,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/fields/package.json b/packages/fields/package.json index e0b7125cf3e4eb..34ef8992f93adf 100644 --- a/packages/fields/package.json +++ b/packages/fields/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": [ "build-style/**", @@ -62,6 +63,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/format-library/package.json b/packages/format-library/package.json index f07ba0f4b61b35..41852910ff5389 100644 --- a/packages/format-library/package.json +++ b/packages/format-library/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/a11y": "*", @@ -46,6 +47,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/hooks/package.json b/packages/hooks/package.json index d0f2fd381b83ca..857cb24a877468 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -25,12 +25,12 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7" }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/html-entities/package.json b/packages/html-entities/package.json index d717a89bf049b8..4ecab2056c9c3a 100644 --- a/packages/html-entities/package.json +++ b/packages/html-entities/package.json @@ -26,12 +26,12 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7" }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 33de2873f75a6a..53e81b64a65349 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "bin": { "pot-to-php": "./tools/pot-to-php.js" @@ -39,6 +40,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/icons/package.json b/packages/icons/package.json index 125b6f19beaa02..895f2e184b4e48 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -16,7 +16,6 @@ "url": "git+https://github.com/WordPress/gutenberg.git", "directory": "packages/icons" }, - "sideEffects": false, "bugs": { "url": "https://github.com/WordPress/gutenberg/issues" }, @@ -27,7 +26,9 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", + "sideEffects": false, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/element": "*", @@ -35,6 +36,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/interactivity-router/package.json b/packages/interactivity-router/package.json index ce9b268af556ac..378ddda56ee76b 100644 --- a/packages/interactivity-router/package.json +++ b/packages/interactivity-router/package.json @@ -25,8 +25,8 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", - "types": "build-types", "wpScriptModuleExports": "./build-module/index.js", + "types": "build-types", "dependencies": { "@wordpress/a11y": "*", "@wordpress/interactivity": "*" diff --git a/packages/interactivity/package.json b/packages/interactivity/package.json index 106ed44bf44d39..c9edd586bc9959 100644 --- a/packages/interactivity/package.json +++ b/packages/interactivity/package.json @@ -25,11 +25,11 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", - "types": "build-types", "wpScriptModuleExports": { ".": "./build-module/index.js", "./debug": "./build-module/debug.js" }, + "types": "build-types", "dependencies": { "@preact/signals": "^1.3.0", "preact": "^10.24.2" diff --git a/packages/interface/package.json b/packages/interface/package.json index 807135ae0160a6..f6a7952cb0d051 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": [ "build-style/**", "src/**/*.scss", @@ -52,6 +53,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/is-shallow-equal/package.json b/packages/is-shallow-equal/package.json index 8da2643a58b840..7dafdea88e7a4f 100644 --- a/packages/is-shallow-equal/package.json +++ b/packages/is-shallow-equal/package.json @@ -34,6 +34,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -41,6 +42,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/keyboard-shortcuts/package.json b/packages/keyboard-shortcuts/package.json index 50ee79d554a89f..ce029907c0dbf4 100644 --- a/packages/keyboard-shortcuts/package.json +++ b/packages/keyboard-shortcuts/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/data": "*", @@ -36,6 +37,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/keycodes/package.json b/packages/keycodes/package.json index 3e820ef68cf97e..2038db1984760f 100644 --- a/packages/keycodes/package.json +++ b/packages/keycodes/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -33,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/list-reusable-blocks/package.json b/packages/list-reusable-blocks/package.json index 129909a948ef1d..328695f31925ee 100644 --- a/packages/list-reusable-blocks/package.json +++ b/packages/list-reusable-blocks/package.json @@ -25,6 +25,7 @@ }, "main": "build/index.js", "module": "build-module/index.js", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/api-fetch": "*", @@ -41,6 +42,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/media-utils/package.json b/packages/media-utils/package.json index 20eef4dd83c6b4..e57b0f51844504 100644 --- a/packages/media-utils/package.json +++ b/packages/media-utils/package.json @@ -25,6 +25,7 @@ }, "main": "build/index.js", "module": "build-module/index.js", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", @@ -36,6 +37,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/notices/package.json b/packages/notices/package.json index 34d2253870128b..f150616445b060 100644 --- a/packages/notices/package.json +++ b/packages/notices/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", @@ -36,6 +37,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/npm-package-json-lint-config/CHANGELOG.md b/packages/npm-package-json-lint-config/CHANGELOG.md index 9c0aafedcead1a..9dee828f63fea0 100644 --- a/packages/npm-package-json-lint-config/CHANGELOG.md +++ b/packages/npm-package-json-lint-config/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Enhancement + +- Include `exports`, `wpScript`, `wpScriptModuleExports` and `sideEffects` in the `prefer-property-order` rule ([#66239](https://github.com/WordPress/gutenberg/pull/66239)). + ## 5.11.0 (2024-10-30) ## 5.10.0 (2024-10-16) diff --git a/packages/npm-package-json-lint-config/index.js b/packages/npm-package-json-lint-config/index.js index 831970c59bf3a6..e1abd5e34f99c5 100644 --- a/packages/npm-package-json-lint-config/index.js +++ b/packages/npm-package-json-lint-config/index.js @@ -56,8 +56,12 @@ const defaultConfig = { 'type', 'main', 'module', + 'exports', 'react-native', + 'wpScript', + 'wpScriptModuleExports', 'types', + 'sideEffects', 'bin', 'dependencies', 'devDependencies', diff --git a/packages/nux/package.json b/packages/nux/package.json index ccf1cb774c2424..50a4d5acf6d028 100644 --- a/packages/nux/package.json +++ b/packages/nux/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": [ "build-style/**", "src/**/*.scss", @@ -46,6 +47,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/patterns/package.json b/packages/patterns/package.json index 92ef655dc3c9c7..d29fc9bcf49bca 100644 --- a/packages/patterns/package.json +++ b/packages/patterns/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": [ "build-style/**", "src/**/*.scss", @@ -53,6 +54,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/plugins/package.json b/packages/plugins/package.json index b741c0359b32b1..a926c2fd9a4e17 100644 --- a/packages/plugins/package.json +++ b/packages/plugins/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", @@ -43,6 +44,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/preferences-persistence/package.json b/packages/preferences-persistence/package.json index e2623eac1a021c..05d2cf7031929d 100644 --- a/packages/preferences-persistence/package.json +++ b/packages/preferences-persistence/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": false, "dependencies": { "@babel/runtime": "7.25.7", @@ -33,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/preferences/package.json b/packages/preferences/package.json index ef231f359ba143..205f9b5d4966b1 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -27,6 +27,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": false, "dependencies": { "@babel/runtime": "7.25.7", @@ -47,6 +48,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/primitives/package.json b/packages/primitives/package.json index 04c3cc86dddec3..d24bc1acf25e2d 100644 --- a/packages/primitives/package.json +++ b/packages/primitives/package.json @@ -26,10 +26,11 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, + "types": "build-types", "sideEffects": [ "src/**/*.scss" ], - "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/element": "*", @@ -40,6 +41,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/priority-queue/package.json b/packages/priority-queue/package.json index 91020c0f81db24..8c98b0b3552198 100644 --- a/packages/priority-queue/package.json +++ b/packages/priority-queue/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -34,6 +35,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/private-apis/package.json b/packages/private-apis/package.json index 9364a596c39af0..84436470521332 100644 --- a/packages/private-apis/package.json +++ b/packages/private-apis/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -33,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/react-i18n/package.json b/packages/react-i18n/package.json index d98a4d7711f89c..31c4d98fa475e0 100644 --- a/packages/react-i18n/package.json +++ b/packages/react-i18n/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -35,6 +36,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/redux-routine/package.json b/packages/redux-routine/package.json index 489bc14632ded2..b3aa6fa79474a8 100644 --- a/packages/redux-routine/package.json +++ b/packages/redux-routine/package.json @@ -27,6 +27,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -40,6 +41,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/reusable-blocks/package.json b/packages/reusable-blocks/package.json index 82a812163a0ccc..e2649609016642 100644 --- a/packages/reusable-blocks/package.json +++ b/packages/reusable-blocks/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": [ "{src,build,build-module}/{index.js,store/index.js}" ], @@ -48,6 +49,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/rich-text/package.json b/packages/rich-text/package.json index 4a5fe0f8e9d5ca..f038e097668984 100644 --- a/packages/rich-text/package.json +++ b/packages/rich-text/package.json @@ -25,11 +25,12 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, + "types": "build-types", "sideEffects": [ "src/**/*.scss", "{src,build,build-module}/{index.js,store/index.js}" ], - "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/a11y": "*", @@ -47,6 +48,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/router/package.json b/packages/router/package.json index 1822e79a317102..3d80481c9b6baa 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7", @@ -38,6 +39,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/server-side-render/package.json b/packages/server-side-render/package.json index 0bb27f17ad62d0..cdfe9679c5049d 100644 --- a/packages/server-side-render/package.json +++ b/packages/server-side-render/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/api-fetch": "*", @@ -45,6 +46,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/shortcode/package.json b/packages/shortcode/package.json index f85efeb91e1803..c476788e3cfaf8 100644 --- a/packages/shortcode/package.json +++ b/packages/shortcode/package.json @@ -25,12 +25,12 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "memize": "^2.0.1" }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/style-engine/package.json b/packages/style-engine/package.json index 76ce2ccbb1445d..378f4dce91dad9 100644 --- a/packages/style-engine/package.json +++ b/packages/style-engine/package.json @@ -27,6 +27,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -35,6 +36,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/sync/package.json b/packages/sync/package.json index 95be09803a75f1..d7181479327d3a 100644 --- a/packages/sync/package.json +++ b/packages/sync/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -41,6 +42,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/token-list/package.json b/packages/token-list/package.json index 0d966edeb9ee7d..370d50e5b4700a 100644 --- a/packages/token-list/package.json +++ b/packages/token-list/package.json @@ -25,12 +25,12 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "dependencies": { "@babel/runtime": "7.25.7" }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/undo-manager/package.json b/packages/undo-manager/package.json index f0464d7fd2f9e2..66f895f8da887d 100644 --- a/packages/undo-manager/package.json +++ b/packages/undo-manager/package.json @@ -26,6 +26,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -34,6 +35,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/url/package.json b/packages/url/package.json index 885efe28f8e8b4..2ecdb8eae18113 100644 --- a/packages/url/package.json +++ b/packages/url/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "dependencies": { @@ -33,6 +34,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/viewport/package.json b/packages/viewport/package.json index 05e098f65e1aeb..224da8a871addf 100644 --- a/packages/viewport/package.json +++ b/packages/viewport/package.json @@ -25,6 +25,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/compose": "*", @@ -36,6 +37,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/vips/package.json b/packages/vips/package.json index 810b8d2b5c9fc4..69912b2eaed71e 100644 --- a/packages/vips/package.json +++ b/packages/vips/package.json @@ -25,12 +25,12 @@ }, "main": "build/index.js", "module": "build-module/index.js", + "wpScript": true, "types": "build-types", "dependencies": { "wasm-vips": "^0.0.10" }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/warning/package.json b/packages/warning/package.json index cae2aefa421ffe..d9c5a4dd83dc10 100644 --- a/packages/warning/package.json +++ b/packages/warning/package.json @@ -25,10 +25,10 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "types": "build-types", "sideEffects": false, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/widgets/package.json b/packages/widgets/package.json index b7fa362d615856..a755890c48ed92 100644 --- a/packages/widgets/package.json +++ b/packages/widgets/package.json @@ -23,6 +23,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "dependencies": { "@babel/runtime": "7.25.7", "@wordpress/api-fetch": "*", @@ -44,6 +45,5 @@ }, "publishConfig": { "access": "public" - }, - "wpScript": true + } } diff --git a/packages/wordcount/package.json b/packages/wordcount/package.json index a9f8304f79d8ff..117e2227a926c8 100644 --- a/packages/wordcount/package.json +++ b/packages/wordcount/package.json @@ -25,12 +25,12 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "wpScript": true, "sideEffects": false, "dependencies": { "@babel/runtime": "7.25.7" }, "publishConfig": { "access": "public" - }, - "wpScript": true + } }