From 4df4c27a380eb96be152db172f747d49c08f5c85 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Tue, 25 Aug 2026 16:49:48 +0530 Subject: [PATCH] DataViews: Declare dependencies imported by the ./wp bundle The ./wp bundle (build-wp/index.js) keeps the third-party imports of the bundled @wordpress/* packages external, so consumers could only resolve them through hoisting. Declare them, plus @wordpress/hooks, and drop the dependency-audit ignore rule that masked them. --- package-lock.json | 111 ++++++++++++++---- packages/dataviews/CHANGELOG.md | 1 + packages/dataviews/package.json | 21 +++- packages/dataviews/tsconfig.build.json | 1 + packages/dataviews/tsconfig.stories.json | 1 + tools/validation/dependency-audit.config.json | 5 - 6 files changed, 114 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 650a087076d2b9..1d4bff17ff76f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2747,6 +2747,19 @@ "stylis": "4.2.0" } }, + "node_modules/@emotion/css": { + "version": "11.13.5", + "resolved": "https://registry.npmjs.org/@emotion/css/-/css-11.13.5.tgz", + "integrity": "sha512-wQdD0Xhkn3Qy2VNcIzbLP9MR8TafI0MJb7BEAXKp+w4+XqErksWR4OXomuDzPsN4InLdGhVe6EYcn2ZIUCpB8w==", + "license": "MIT", + "dependencies": { + "@emotion/babel-plugin": "^11.13.5", + "@emotion/cache": "^11.13.5", + "@emotion/serialize": "^1.3.3", + "@emotion/sheet": "^1.4.0", + "@emotion/utils": "^1.4.2" + } + }, "node_modules/@emotion/css-prettifier": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@emotion/css-prettifier/-/css-prettifier-1.2.0.tgz", @@ -27215,6 +27228,33 @@ "node": ">=0.10.0" } }, + "node_modules/framer-motion": { + "version": "11.18.2", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.18.2.tgz", + "integrity": "sha512-5F5Och7wrvtLVElIpclDT0CBzMVg3dL22B64aZwHtsIY8RB4mXICLrkajK4G9R+ieSAGcgrLeae2SeUTg2pr6w==", + "license": "MIT", + "dependencies": { + "motion-dom": "^11.18.1", + "motion-utils": "^11.18.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -37495,14 +37535,19 @@ } }, "node_modules/motion-dom": { - "version": "11.14.3", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.14.3.tgz", - "integrity": "sha512-lW+D2wBy5vxLJi6aCP0xyxTxlTfiu+b+zcpVbGVFUxotwThqhdpPRSmX8xztAgtZMPMeU0WGVn/k1w4I+TbPqA==" + "version": "11.18.1", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.18.1.tgz", + "integrity": "sha512-g76KvA001z+atjfxczdRtw/RXOM3OMSdd1f4DL77qCTF/+avrRJiawSG4yDibEQ215sr9kpinSlX2pCTJ9zbhw==", + "license": "MIT", + "dependencies": { + "motion-utils": "^11.18.1" + } }, "node_modules/motion-utils": { - "version": "11.14.3", - "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-11.14.3.tgz", - "integrity": "sha512-Xg+8xnqIJTpr0L/cidfTTBFkvRw26ZtGGuIhA94J9PQ2p4mEa06Xx7QVYZH0BP+EpMSaDlu+q0I0mmvwADPsaQ==" + "version": "11.18.1", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-11.18.1.tgz", + "integrity": "sha512-49Kt+HKjtbJKLtgO/LKj9Ld+6vw9BjH5d9sc40R/kVyH8GLAXgT42M2NnuPcJNuA3s9ZfZBUcwIgpmZWGEE+hA==", + "license": "MIT" }, "node_modules/mousetrap": { "version": "1.6.5", @@ -42283,6 +42328,16 @@ "react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0" } }, + "node_modules/react-colorful": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-5.8.0.tgz", + "integrity": "sha512-Wy9OzPfjSN9bF12OB8N7UQvlsZ0I+7wHxpN+bV5BjNQGxOj6IiwkRjevJK9yOBjJWGQvAaf1OXtn8rUeEatAng==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, "node_modules/react-docgen": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/react-docgen/-/react-docgen-8.0.3.tgz", @@ -50963,19 +51018,6 @@ } } }, - "packages/components/node_modules/@emotion/css": { - "version": "11.13.5", - "resolved": "https://registry.npmjs.org/@emotion/css/-/css-11.13.5.tgz", - "integrity": "sha512-wQdD0Xhkn3Qy2VNcIzbLP9MR8TafI0MJb7BEAXKp+w4+XqErksWR4OXomuDzPsN4InLdGhVe6EYcn2ZIUCpB8w==", - "license": "MIT", - "dependencies": { - "@emotion/babel-plugin": "^11.13.5", - "@emotion/cache": "^11.13.5", - "@emotion/serialize": "^1.3.3", - "@emotion/sheet": "^1.4.0", - "@emotion/utils": "^1.4.2" - } - }, "packages/components/node_modules/framer-motion": { "version": "11.15.0", "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.15.0.tgz", @@ -51389,7 +51431,16 @@ "license": "GPL-2.0-or-later", "dependencies": { "@ariakit/react": "^0.4.37", + "@base-ui/react": "^1.7.0", "@date-fns/tz": "^1.5.0", + "@daypicker/react": "^10.0.1", + "@emotion/cache": "^11.14.0", + "@emotion/css": "^11.13.5", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.1", + "@emotion/utils": "^1.4.2", + "@floating-ui/react-dom": "^2.1.9", + "@use-gesture/react": "^10.3.1", "@wordpress/a11y": "file:../a11y", "@wordpress/base-styles": "file:../base-styles", "@wordpress/components": "file:../components", @@ -51398,18 +51449,28 @@ "@wordpress/date": "file:../date", "@wordpress/deprecated": "file:../deprecated", "@wordpress/element": "file:../element", + "@wordpress/hooks": "file:../hooks", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/kebab-case": "file:../kebab-case", "@wordpress/keycodes": "file:../keycodes", "@wordpress/ui": "file:../ui", "@wordpress/warning": "file:../warning", + "change-case": "^4.1.2", "clsx": "^2.1.1", "colord": "^2.9.3", + "colorjs.io": "^0.7.1", "date-fns": "^4.4.0", "deepmerge": "^4.3.1", "fast-deep-equal": "^3.1.3", - "remove-accents": "^0.5.0" + "framer-motion": "^11.15.0", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.1.0", + "memize": "^2.1.1", + "react-colorful": "^5.6.1", + "remove-accents": "^0.5.0", + "use-memo-one": "^1.1.1", + "uuid": "^14.0.0" }, "devDependencies": { "@storybook/addon-docs": "^10.5.3", @@ -51438,6 +51499,16 @@ } } }, + "packages/dataviews/node_modules/colorjs.io": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.7.1.tgz", + "integrity": "sha512-LY7OHnJZxHwT5UlzNa9bbhHHDbzB6yE5+3MIPwJEQKRvSCt/T4G7epsj+9j2BExUIIfXFIJGsIXUKdfrK9Q5tA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/color" + } + }, "packages/date": { "name": "@wordpress/date", "version": "5.54.0", diff --git a/packages/dataviews/CHANGELOG.md b/packages/dataviews/CHANGELOG.md index 89faab3160779d..1b22981acbda60 100644 --- a/packages/dataviews/CHANGELOG.md +++ b/packages/dataviews/CHANGELOG.md @@ -56,6 +56,7 @@ ### Internal +- Declare the dependencies imported by the `./wp` bundle (`build-wp/index.js`) so they resolve without relying on hoisting. ([#81843](https://github.com/WordPress/gutenberg/pull/81843)) - DataViews: Use `Menu.PrefixIcon` for table column menu icons. ([#82346](https://github.com/WordPress/gutenberg/pull/82346)) - DataForm date control: Space `ValidityIndicator` with `Stack` now that the indicator has no outer margin. ([#82267](https://github.com/WordPress/gutenberg/pull/82267)) - Add a `HierarchicalLevels` story that demonstrates `getItemLevel` and `view.showLevels` in the table layout ([#82344](https://github.com/WordPress/gutenberg/pull/82344)). diff --git a/packages/dataviews/package.json b/packages/dataviews/package.json index fac5cee3f37b30..b6efaf68e0845b 100644 --- a/packages/dataviews/package.json +++ b/packages/dataviews/package.json @@ -52,7 +52,16 @@ "sideEffects": false, "dependencies": { "@ariakit/react": "^0.4.37", + "@base-ui/react": "^1.7.0", "@date-fns/tz": "^1.5.0", + "@daypicker/react": "^10.0.1", + "@emotion/cache": "^11.14.0", + "@emotion/css": "^11.13.5", + "@emotion/react": "^11.14.0", + "@emotion/styled": "^11.14.1", + "@emotion/utils": "^1.4.2", + "@floating-ui/react-dom": "^2.1.9", + "@use-gesture/react": "^10.3.1", "@wordpress/a11y": "file:../a11y", "@wordpress/base-styles": "file:../base-styles", "@wordpress/components": "file:../components", @@ -61,18 +70,28 @@ "@wordpress/date": "file:../date", "@wordpress/deprecated": "file:../deprecated", "@wordpress/element": "file:../element", + "@wordpress/hooks": "file:../hooks", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/kebab-case": "file:../kebab-case", "@wordpress/keycodes": "file:../keycodes", "@wordpress/ui": "file:../ui", "@wordpress/warning": "file:../warning", + "change-case": "^4.1.2", "clsx": "^2.1.1", "colord": "^2.9.3", + "colorjs.io": "^0.7.1", "date-fns": "^4.4.0", "deepmerge": "^4.3.1", "fast-deep-equal": "^3.1.3", - "remove-accents": "^0.5.0" + "framer-motion": "^11.15.0", + "highlight-words-core": "^1.2.2", + "is-plain-object": "^5.1.0", + "memize": "^2.1.1", + "react-colorful": "^5.6.1", + "remove-accents": "^0.5.0", + "use-memo-one": "^1.1.1", + "uuid": "^14.0.0" }, "devDependencies": { "@storybook/addon-docs": "^10.5.3", diff --git a/packages/dataviews/tsconfig.build.json b/packages/dataviews/tsconfig.build.json index 1a0433a39d8276..96a3644cab3617 100644 --- a/packages/dataviews/tsconfig.build.json +++ b/packages/dataviews/tsconfig.build.json @@ -16,6 +16,7 @@ { "path": "../date" }, { "path": "../deprecated/tsconfig.build.json" }, { "path": "../element/tsconfig.build.json" }, + { "path": "../hooks" }, { "path": "../i18n/tsconfig.build.json" }, { "path": "../icons/tsconfig.build.json" }, { "path": "../kebab-case" }, diff --git a/packages/dataviews/tsconfig.stories.json b/packages/dataviews/tsconfig.stories.json index 4b8c01b7426079..7f4e1a5838f669 100644 --- a/packages/dataviews/tsconfig.stories.json +++ b/packages/dataviews/tsconfig.stories.json @@ -29,6 +29,7 @@ { "path": "../date" }, { "path": "../deprecated/tsconfig.build.json" }, { "path": "../element/tsconfig.build.json" }, + { "path": "../hooks" }, { "path": "../i18n/tsconfig.build.json" }, { "path": "../icons/tsconfig.build.json" }, { "path": "../kebab-case" }, diff --git a/tools/validation/dependency-audit.config.json b/tools/validation/dependency-audit.config.json index 98f38b670bebf6..4c8de490bd1571 100644 --- a/tools/validation/dependency-audit.config.json +++ b/tools/validation/dependency-audit.config.json @@ -24,11 +24,6 @@ "comment": "@wordpress/e2e-tests ships test-fixture plugins under plugins/ (imports of @wordpress/connectors as test data and sibling `test/*` script-modules registered by the harness, not real npm packages). Scoped to that package and path so it can never mask a real finding elsewhere.", "target": "@wordpress/e2e-tests", "path": "plugins/**" - }, - { - "comment": "@wordpress/dataviews `./wp` bundle (build-wp/, built by packages/dataviews/build.cjs) inlines other @wordpress/* packages but keeps their third-party imports external, so they are undeclared. Not fixing: the bundle is about to be removed along with the private APIs, see https://github.com/WordPress/gutenberg/pull/81843#issuecomment-5354950365", - "target": "@wordpress/dataviews", - "path": "build-wp/**" } ] }