From 0514069d7bf55e8639440c78fa45571d46630dbf Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 18:14:26 -0800 Subject: [PATCH 01/12] Added Missing Blocks Dependencies --- plugins/woocommerce-blocks/package.json | 3 + pnpm-lock.yaml | 434 +++++++++++------------- 2 files changed, 198 insertions(+), 239 deletions(-) diff --git a/plugins/woocommerce-blocks/package.json b/plugins/woocommerce-blocks/package.json index 4ccfc045443..714890492fb 100644 --- a/plugins/woocommerce-blocks/package.json +++ b/plugins/woocommerce-blocks/package.json @@ -113,6 +113,7 @@ "@babel/plugin-proposal-class-properties": "7.18.6", "@babel/plugin-proposal-optional-chaining": "7.21.0", "@babel/plugin-syntax-jsx": "7.22.5", + "@babel/preset-react": "7.23.3", "@babel/polyfill": "7.12.1", "@babel/preset-typescript": "7.23.2", "@bartekbp/typescript-checkstyle": "5.0.0", @@ -144,6 +145,7 @@ "@types/jest-environment-puppeteer": "5.0.2", "@types/jquery": "3.5.14", "@types/lodash": "4.14.182", + "@types/prop-types": "^15.7.11", "@types/puppeteer": "5.4.6", "@types/react": "^17.0.71", "@types/react-dom": "18.0.10", @@ -292,6 +294,7 @@ "html-react-parser": "3.0.4", "postcode-validator": "3.8.15", "preact": "^10.19.3", + "prop-types": "^15.8.1", "react-number-format": "4.9.3", "react-transition-group": "^4.4.5", "reakit": "1.3.11", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb735852549..84a4af20c10 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,7 +73,7 @@ importers: version: 7.0.4 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) lint-staged: specifier: ^12.5.0 version: 12.5.0 @@ -167,10 +167,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-mock-extended: specifier: ^1.0.18 version: 1.0.18(jest@27.5.1)(typescript@5.3.3) @@ -222,10 +222,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) postcss-loader: specifier: ^4.3.0 version: 4.3.0(postcss@8.4.32)(webpack@5.89.0) @@ -349,10 +349,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) mini-css-extract-plugin: specifier: ^2.7.6 version: 2.7.6(webpack@5.89.0) @@ -431,7 +431,7 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) ts-jest: specifier: ~29.1.1 version: 29.1.1(@babel/core@7.23.5)(babel-jest@27.5.1)(jest@27.5.1)(typescript@5.3.3) @@ -449,7 +449,7 @@ importers: version: 10.0.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-allure: specifier: ^0.1.3 version: 0.1.3 @@ -538,10 +538,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) postcss: specifier: ^8.4.32 version: 8.4.32 @@ -863,10 +863,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) postcss: specifier: ^8.4.32 version: 8.4.32 @@ -934,10 +934,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -989,10 +989,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -1095,10 +1095,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) postcss: specifier: ^8.4.32 version: 8.4.32 @@ -1243,10 +1243,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) redux: specifier: ^4.2.1 version: 4.2.1 @@ -1316,10 +1316,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -1347,10 +1347,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -1377,7 +1377,7 @@ importers: version: 0.2.0 '@woocommerce/e2e-utils': specifier: ^0.1.6 - version: 0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0) + version: 0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0) '@wordpress/deprecated': specifier: wp-6.0 version: 3.6.1 @@ -1462,7 +1462,7 @@ importers: version: 3.3.7 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-circus: specifier: 27.5.1 version: 27.5.1 @@ -1636,10 +1636,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -1757,10 +1757,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) postcss: specifier: ^8.4.32 version: 8.4.32 @@ -1839,10 +1839,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -1882,10 +1882,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -1972,10 +1972,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) ts-jest: specifier: ~29.1.1 version: 29.1.1(@babel/core@7.23.5)(babel-jest@27.5.1)(jest@27.5.1)(typescript@5.3.3) @@ -2020,7 +2020,7 @@ importers: version: 5.16.2 '@testing-library/react': specifier: 12.1.3 - version: 12.1.3(react-dom@18.2.0)(react@17.0.2) + version: 12.1.3(react-dom@17.0.2)(react@17.0.2) '@wordpress/data': specifier: wp-6.0 version: 6.6.1(react@17.0.2) @@ -2048,10 +2048,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) resize-observer-polyfill: specifier: 1.5.1 version: 1.5.1 @@ -2106,10 +2106,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -2188,10 +2188,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -2249,10 +2249,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) redux: specifier: ^4.2.1 version: 4.2.1 @@ -2298,10 +2298,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -2353,7 +2353,7 @@ importers: version: 7.23.5 '@storybook/addon-knobs': specifier: ^7.0.2 - version: 7.0.2(@storybook/addons@7.6.4)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2) + version: 7.0.2(@storybook/addons@7.5.2)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2) '@testing-library/react': specifier: 12.1.3 version: 12.1.3(react-dom@16.14.0)(react@17.0.2) @@ -2395,10 +2395,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) postcss: specifier: ^8.4.32 version: 8.4.32 @@ -2645,10 +2645,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) mini-css-extract-plugin: specifier: ^2.7.6 version: 2.7.6(webpack@5.89.0) @@ -2712,10 +2712,10 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-cli: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) rimraf: specifier: ^3.0.2 version: 3.0.2 @@ -2954,7 +2954,7 @@ importers: version: 1.0.0-alpha.2 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) mocha: specifier: 7.2.0 version: 7.2.0 @@ -3435,7 +3435,7 @@ importers: version: 8.0.0(typescript@5.3.3)(webpack@5.89.0) jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) jest-environment-jsdom: specifier: ~27.5.1 version: 27.5.1 @@ -3749,6 +3749,9 @@ importers: preact: specifier: ^10.19.3 version: 10.19.3 + prop-types: + specifier: ^15.8.1 + version: 15.8.1 react: specifier: ^17.0.2 version: 17.0.2 @@ -3811,6 +3814,9 @@ importers: '@babel/polyfill': specifier: 7.12.1 version: 7.12.1 + '@babel/preset-react': + specifier: 7.23.3 + version: 7.23.3(@babel/core@7.23.2) '@babel/preset-typescript': specifier: 7.23.2 version: 7.23.2(@babel/core@7.23.2) @@ -3901,6 +3907,9 @@ importers: '@types/lodash': specifier: 4.14.182 version: 4.14.182 + '@types/prop-types': + specifier: ^15.7.11 + version: 15.7.11 '@types/puppeteer': specifier: 5.4.6 version: 5.4.6 @@ -4583,7 +4592,7 @@ importers: version: 8.55.0 jest: specifier: ~27.5.1 - version: 27.5.1 + version: 27.5.1(ts-node@10.9.2) ts-jest: specifier: ~29.1.1 version: 29.1.1(@babel/core@7.23.5)(babel-jest@27.5.1)(jest@27.5.1)(typescript@5.3.3) @@ -5975,7 +5984,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.12.9 - '@babel/helper-plugin-utils': 7.10.4 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.12.9) '@babel/plugin-transform-parameters': 7.23.3(@babel/core@7.12.9) dev: true @@ -6459,6 +6468,15 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: true + /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.12.9): + resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.12.9 + '@babel/helper-plugin-utils': 7.22.5 + /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.2): resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} engines: {node: '>=6.9.0'} @@ -10127,7 +10145,7 @@ packages: - utf-8-validate dev: true - /@jest/core@27.5.1: + /@jest/core@27.5.1(ts-node@10.9.2): resolution: {integrity: sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} peerDependencies: @@ -10171,51 +10189,6 @@ packages: - ts-node - utf-8-validate - /@jest/core@27.5.1(ts-node@10.9.2): - resolution: {integrity: sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/console': 27.5.1 - '@jest/reporters': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/transform': 27.5.1 - '@jest/types': 27.5.1 - '@types/node': 20.10.4 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.8.1 - exit: 0.1.2 - graceful-fs: 4.2.11 - jest-changed-files: 27.5.1 - jest-config: 27.5.1(ts-node@10.9.2) - jest-haste-map: 27.5.1 - jest-message-util: 27.5.1 - jest-regex-util: 27.5.1 - jest-resolve: 27.5.1 - jest-resolve-dependencies: 27.5.1 - jest-runner: 27.5.1 - jest-runtime: 27.5.1 - jest-snapshot: 27.5.1 - jest-util: 27.5.1 - jest-validate: 27.5.1 - jest-watcher: 27.5.1 - micromatch: 4.0.5 - rimraf: 3.0.2 - slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - ts-node - - utf-8-validate - dev: true - /@jest/core@29.7.0(ts-node@10.9.2): resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -13520,7 +13493,7 @@ packages: '@react-native-community/cli-tools': 12.1.1 chalk: 4.1.2 execa: 5.1.1 - fast-xml-parser: 4.3.2 + fast-xml-parser: 4.2.4 glob: 7.2.3 logkitty: 0.7.1 transitivePeerDependencies: @@ -13532,7 +13505,7 @@ packages: '@react-native-community/cli-tools': 12.1.1 chalk: 4.1.2 execa: 5.1.1 - fast-xml-parser: 4.3.2 + fast-xml-parser: 4.2.4 glob: 7.2.3 ora: 5.4.1 transitivePeerDependencies: @@ -14464,7 +14437,7 @@ packages: react-select: 3.2.0(react-dom@17.0.2)(react@17.0.2) dev: true - /@storybook/addon-knobs@7.0.2(@storybook/addons@7.6.4)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2): + /@storybook/addon-knobs@7.0.2(@storybook/addons@7.5.2)(@storybook/api@7.6.4)(@storybook/components@7.6.4)(@storybook/core-events@7.6.4)(@storybook/theming@7.6.4)(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2): resolution: {integrity: sha512-PzKuscxcBPhA2jpDxJ/F+BvBRqHJ8qBki1kS1IOjmJbAfE96WFnweXZ73ImyAJnRtmtReCL6p0ZmFkrNDMDpUw==} peerDependencies: '@storybook/addons': ^7.0.0 @@ -14480,7 +14453,7 @@ packages: react-dom: optional: true dependencies: - '@storybook/addons': 7.6.4(react-dom@16.14.0)(react@17.0.2) + '@storybook/addons': 7.5.2(react-dom@16.14.0)(react@17.0.2) '@storybook/api': 7.6.4(react-dom@16.14.0)(react@17.0.2) '@storybook/components': 7.6.4(@types/react@17.0.71)(react-dom@16.14.0)(react@17.0.2) '@storybook/core-events': 7.6.4 @@ -14769,6 +14742,19 @@ packages: regenerator-runtime: 0.13.11 dev: true + /@storybook/addons@7.5.2(react-dom@16.14.0)(react@17.0.2): + resolution: {integrity: sha512-hRiy56zQbz72Pwa4F40srUWXKGNIriNkZ1R0j5KPd8ZqoMk1hIeW0S8E7s1vuM/MplnUE/jFJZqu6HQCvbqmGg==} + peerDependencies: + react: ^17.0.2 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + '@storybook/manager-api': 7.5.2(react-dom@16.14.0)(react@17.0.2) + '@storybook/preview-api': 7.5.2 + '@storybook/types': 7.5.2 + react: 17.0.2 + react-dom: 16.14.0(react@17.0.2) + dev: true + /@storybook/addons@7.5.2(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-hRiy56zQbz72Pwa4F40srUWXKGNIriNkZ1R0j5KPd8ZqoMk1hIeW0S8E7s1vuM/MplnUE/jFJZqu6HQCvbqmGg==} peerDependencies: @@ -14782,17 +14768,6 @@ packages: react-dom: 17.0.2(react@17.0.2) dev: true - /@storybook/addons@7.6.4(react-dom@16.14.0)(react@17.0.2): - resolution: {integrity: sha512-YnmLyR/ciALtzoi9HEu+Y+NJWeOVEBo9PRgQaG7zGiNDvOrLY69uU3Ej0+TZlrTqBqce42bRCrDINJfnk0Mfsg==} - dependencies: - '@storybook/manager-api': 7.6.4(react-dom@16.14.0)(react@17.0.2) - '@storybook/preview-api': 7.6.4 - '@storybook/types': 7.6.4 - transitivePeerDependencies: - - react - - react-dom - dev: true - /@storybook/api@6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-sj5XQXyTTxKDSqNVBlOO1h2+v8NO4EB7/7kBLOD8jpU4r4UUCLrf6G9b54j7R9/dIyi2XvrKVlp95q3yRE3zmg==} peerDependencies: @@ -16064,6 +16039,31 @@ packages: resolution: {integrity: sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==} dev: true + /@storybook/manager-api@7.5.2(react-dom@16.14.0)(react@17.0.2): + resolution: {integrity: sha512-WX8GjBkITRQzhQ08WEAVjdDW8QqqIQhWOpFzXUYCxCNzt1eSALI31QQ+M1/MYymw+TOkotC/SMcn/puIAm4rdA==} + peerDependencies: + react: ^17.0.2 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + '@storybook/channels': 7.5.2 + '@storybook/client-logger': 7.5.2 + '@storybook/core-events': 7.5.2 + '@storybook/csf': 0.1.2 + '@storybook/global': 5.0.0 + '@storybook/router': 7.5.2(react-dom@16.14.0)(react@17.0.2) + '@storybook/theming': 7.5.2(react-dom@16.14.0)(react@17.0.2) + '@storybook/types': 7.5.2 + dequal: 2.0.3 + lodash: 4.17.21 + memoizerific: 1.11.3 + react: 17.0.2 + react-dom: 16.14.0(react@17.0.2) + semver: 7.5.4 + store2: 2.14.2 + telejson: 7.2.0 + ts-dedent: 2.2.0 + dev: true + /@storybook/manager-api@7.5.2(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-WX8GjBkITRQzhQ08WEAVjdDW8QqqIQhWOpFzXUYCxCNzt1eSALI31QQ+M1/MYymw+TOkotC/SMcn/puIAm4rdA==} peerDependencies: @@ -16800,6 +16800,19 @@ packages: regenerator-runtime: 0.13.11 dev: true + /@storybook/router@7.5.2(react-dom@16.14.0)(react@17.0.2): + resolution: {integrity: sha512-jlh48TVUlqvGkU8MnkVp9SrCHomWGtQGx1WMK94NMyOPVPTLWzM6LjIybgmHz0MTe4lpzmbiIOfSlU3pPX054w==} + peerDependencies: + react: ^17.0.2 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + '@storybook/client-logger': 7.5.2 + memoizerific: 1.11.3 + qs: 6.11.2 + react: 17.0.2 + react-dom: 16.14.0(react@17.0.2) + dev: true + /@storybook/router@7.5.2(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-jlh48TVUlqvGkU8MnkVp9SrCHomWGtQGx1WMK94NMyOPVPTLWzM6LjIybgmHz0MTe4lpzmbiIOfSlU3pPX054w==} peerDependencies: @@ -16947,6 +16960,20 @@ packages: regenerator-runtime: 0.13.11 dev: true + /@storybook/theming@7.5.2(react-dom@16.14.0)(react@17.0.2): + resolution: {integrity: sha512-DZBTcYErSYvmTYsGz7lKtiIcBe8flBw5Ojp52r3O4GcRYG4AbuUwwVvehz+O1cWaS+UW3HavrcgapERH7ZHd1A==} + peerDependencies: + react: ^17.0.2 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@17.0.2) + '@storybook/client-logger': 7.5.2 + '@storybook/global': 5.0.0 + memoizerific: 1.11.3 + react: 17.0.2 + react-dom: 16.14.0(react@17.0.2) + dev: true + /@storybook/theming@7.5.2(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-DZBTcYErSYvmTYsGz7lKtiIcBe8flBw5Ojp52r3O4GcRYG4AbuUwwVvehz+O1cWaS+UW3HavrcgapERH7ZHd1A==} peerDependencies: @@ -17790,21 +17817,6 @@ packages: '@types/react-dom': 18.2.17 react: 17.0.2 react-dom: 17.0.2(react@17.0.2) - dev: true - - /@testing-library/react@12.1.3(react-dom@18.2.0)(react@17.0.2): - resolution: {integrity: sha512-oCULRXWRrBtC9m6G/WohPo1GLcLesH7T4fuKzRAKn1CWVu9BzXtqLXDDTA6KhFNNtRwLtfSMr20HFl+Qrdrvmg==} - engines: {node: '>=12'} - peerDependencies: - react: ^17.0.2 - react-dom: '*' - dependencies: - '@babel/runtime': 7.23.5 - '@testing-library/dom': 8.20.1 - '@types/react-dom': 18.2.17 - react: 17.0.2 - react-dom: 18.2.0(react@17.0.2) - dev: false /@testing-library/react@12.1.5(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg==} @@ -18646,6 +18658,7 @@ packages: dependencies: '@types/react': 17.0.71 '@types/tinycolor2': 1.4.6 + '@types/wordpress__components': 23.0.10(react-dom@16.14.0)(react@17.0.2) '@types/wordpress__notices': 3.27.6(react@17.0.2) '@types/wordpress__rich-text': 6.4.5(react@17.0.2) '@wordpress/element': 4.4.1 @@ -18661,6 +18674,7 @@ packages: dependencies: '@types/react': 17.0.71 '@types/tinycolor2': 1.4.6 + '@types/wordpress__components': 23.0.10(react-dom@17.0.2)(react@17.0.2) '@types/wordpress__notices': 3.27.6(react@17.0.2) '@types/wordpress__rich-text': 6.4.5(react@17.0.2) '@wordpress/element': 4.4.1 @@ -18670,14 +18684,29 @@ packages: - react - react-dom + /@types/wordpress__components@23.0.10(react-dom@16.14.0)(react@17.0.2): + resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==} + dependencies: + '@types/react': 17.0.71 + '@types/tinycolor2': 1.4.6 + '@types/wordpress__notices': 3.27.6(react@17.0.2) + '@types/wordpress__rich-text': 3.4.6 + '@wordpress/element': 5.22.0 + downshift: 6.1.12(react@17.0.2) + re-resizable: 6.9.11(react-dom@16.14.0)(react@17.0.2) + transitivePeerDependencies: + - react + - react-dom + dev: true + /@types/wordpress__components@23.0.10(react-dom@17.0.2)(react@17.0.2): resolution: {integrity: sha512-dI1wP88AkEjhZAdqfz6Pz3lK0EMUEfpXH0omgb6IZ/toz6qpXOG/aemlLskNtPFuNkYYHvD+bwFkLPqKWo9ATA==} dependencies: '@types/react': 17.0.71 '@types/tinycolor2': 1.4.6 '@types/wordpress__notices': 3.27.6(react@17.0.2) - '@types/wordpress__rich-text': 6.4.5(react@17.0.2) - '@wordpress/element': 5.24.0 + '@types/wordpress__rich-text': 3.4.6 + '@wordpress/element': 5.22.0 downshift: 6.1.12(react@17.0.2) re-resizable: 6.9.11(react-dom@17.0.2)(react@17.0.2) transitivePeerDependencies: @@ -20023,14 +20052,14 @@ packages: transitivePeerDependencies: - supports-color - /@woocommerce/e2e-utils@0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0): + /@woocommerce/e2e-utils@0.1.6(@woocommerce/api@0.2.0)(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0): resolution: {integrity: sha512-gWSEgFIjMqaqiiIyrpa1epIHkmBBAfk6WfRojva1f5ZmffSJCc0VbX2jQQRdFm1BuEYr8KGCCYo+q8NIjlMZ7g==} peerDependencies: '@woocommerce/api': ^0.2.0 dependencies: '@woocommerce/api': 0.2.0 '@wordpress/deprecated': 2.12.3 - '@wordpress/e2e-test-utils': 4.16.1(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0) + '@wordpress/e2e-test-utils': 4.16.1(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0) config: 3.3.3 faker: 5.5.3 fishery: 1.4.0 @@ -21291,7 +21320,7 @@ packages: date-fns: 2.30.0 deepmerge: 4.3.1 dom-scroll-into-view: 1.2.1 - downshift: 6.1.7(react@17.0.2) + downshift: 6.1.12(react@17.0.2) fast-deep-equal: 3.1.3 framer-motion: 10.16.16(react-dom@17.0.2)(react@17.0.2) gradient-parser: 0.1.5 @@ -22009,7 +22038,7 @@ packages: '@babel/runtime': 7.23.5 '@wordpress/keycodes': 2.19.3 '@wordpress/url': 2.22.2(react-native@0.73.0) - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) lodash: 4.17.21 node-fetch: 2.7.0 puppeteer: 2.1.1 @@ -22018,7 +22047,7 @@ packages: - react-native dev: false - /@wordpress/e2e-test-utils@4.16.1(jest@29.7.0)(puppeteer@21.6.0)(react-native@0.73.0): + /@wordpress/e2e-test-utils@4.16.1(jest@29.7.0)(puppeteer@2.1.1)(react-native@0.73.0): resolution: {integrity: sha512-Dpsq5m0VSvjIhro2MjACSzkOkOf1jGEryzgEMW1ikbT6YI+motspHfGtisKXgYhZJOnjV4PwuEg+9lPVnd971g==} engines: {node: '>=8'} peerDependencies: @@ -22031,7 +22060,7 @@ packages: jest: 29.7.0(@types/node@16.18.68)(ts-node@10.9.2) lodash: 4.17.21 node-fetch: 2.7.0 - puppeteer: 21.6.0(typescript@5.3.3) + puppeteer: 2.1.1 transitivePeerDependencies: - encoding - react-native @@ -23001,7 +23030,7 @@ packages: jest: '>=26' dependencies: '@babel/runtime': 7.23.5 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) jest-matcher-utils: 26.6.2 lodash: 4.17.21 dev: false @@ -23013,7 +23042,7 @@ packages: jest: '>=27' dependencies: '@babel/runtime': 7.23.5 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) jest-matcher-utils: 27.5.1 /@wordpress/jest-console@5.4.0(jest@29.7.0): @@ -23034,7 +23063,7 @@ packages: jest: '>=27' dependencies: '@babel/runtime': 7.23.5 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) jest-matcher-utils: 27.5.1 dev: true @@ -23059,7 +23088,7 @@ packages: '@babel/core': 7.23.2 '@wordpress/jest-console': 6.11.0(jest@27.5.1) babel-jest: 27.5.1(@babel/core@7.23.2) - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) transitivePeerDependencies: - supports-color dev: true @@ -23110,7 +23139,7 @@ packages: babel-jest: 26.6.3(@babel/core@7.12.9) enzyme: 3.11.0 enzyme-to-json: 3.6.2(enzyme@3.11.0) - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) transitivePeerDependencies: - '@babel/core' - react @@ -23152,7 +23181,7 @@ packages: babel-jest: 27.5.1(@babel/core@7.23.2) enzyme: 3.11.0 enzyme-to-json: 3.6.2(enzyme@3.11.0) - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) transitivePeerDependencies: @@ -23174,7 +23203,7 @@ packages: babel-jest: 27.5.1(@babel/core@7.23.5) enzyme: 3.11.0 enzyme-to-json: 3.6.2(enzyme@3.11.0) - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) react: 17.0.2 react-dom: 17.0.2(react@17.0.2) transitivePeerDependencies: @@ -24093,7 +24122,7 @@ packages: expect-puppeteer: 4.4.0 fast-glob: 3.3.2 filenamify: 4.3.0 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) jest-dev-server: 6.2.0 jest-environment-node: 27.5.1 markdownlint-cli: 0.31.1 @@ -24186,7 +24215,7 @@ packages: expect-puppeteer: 4.4.0 fast-glob: 3.3.2 filenamify: 4.3.0 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) jest-dev-server: 6.2.0 jest-environment-node: 27.5.1 markdownlint-cli: 0.31.1 @@ -26469,7 +26498,7 @@ packages: '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.12.9) '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.12.9) '@babel/plugin-syntax-flow': 7.23.3(@babel/core@7.12.9) - '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.12.9) + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.12.9) '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.12.9) '@babel/plugin-transform-arrow-functions': 7.23.3(@babel/core@7.12.9) '@babel/plugin-transform-block-scoped-functions': 7.23.3(@babel/core@7.12.9) @@ -27739,7 +27768,7 @@ packages: /chromium-edge-launcher@1.0.0: resolution: {integrity: sha512-pgtgjNKZ7i5U++1g1PWv75umkHvhVTDOQIZ+sjeUX9483S7Y6MUvO0lrd7ShGlQlFHMN4SwKTCq/X8hWrbv2KA==} dependencies: - '@types/node': 20.10.4 + '@types/node': 16.18.68 escape-string-regexp: 4.0.0 is-wsl: 2.2.0 lighthouse-logger: 1.4.2 @@ -28671,6 +28700,7 @@ packages: parse-json: 5.2.0 path-type: 4.0.0 typescript: 5.3.3 + dev: true /cp-file@7.0.0: resolution: {integrity: sha512-0Cbj7gyvFVApzpK/uhCtQ/9kE9UnYpxMzaq5nQQC/Dh4iaj5fxp7iEFIullrYwzj8nf0qnsI1Qsx34hAeAebvw==} @@ -29581,6 +29611,7 @@ packages: optional: true dependencies: ms: 2.1.2 + dev: true /debug@4.3.3: resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==} @@ -30319,6 +30350,7 @@ packages: react: 17.0.2 react-is: 17.0.2 tslib: 2.6.2 + dev: false /duplexer3@0.1.5: resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} @@ -31324,7 +31356,7 @@ packages: '@typescript-eslint/eslint-plugin': 5.56.0(@typescript-eslint/parser@5.56.0)(eslint@8.55.0)(typescript@5.3.2) '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.55.0)(typescript@5.3.2) eslint: 8.55.0 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) transitivePeerDependencies: - supports-color - typescript @@ -31346,7 +31378,7 @@ packages: '@typescript-eslint/eslint-plugin': 5.56.0(@typescript-eslint/parser@5.56.0)(eslint@8.55.0)(typescript@5.3.2) '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.3.2) eslint: 8.55.0 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) transitivePeerDependencies: - supports-color - typescript @@ -31368,7 +31400,7 @@ packages: '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.55.0)(typescript@5.3.3) '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@5.3.3) eslint: 8.55.0 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) transitivePeerDependencies: - supports-color - typescript @@ -32491,7 +32523,7 @@ packages: engines: {node: '>= 10.17.0'} hasBin: true dependencies: - debug: 4.3.1 + debug: 4.3.4(supports-color@9.4.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -32580,13 +32612,6 @@ packages: hasBin: true dependencies: strnum: 1.0.5 - dev: true - - /fast-xml-parser@4.3.2: - resolution: {integrity: sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==} - hasBin: true - dependencies: - strnum: 1.0.5 /fastest-levenshtein@1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} @@ -33023,7 +33048,6 @@ packages: /flow-parser@0.223.3: resolution: {integrity: sha512-9KxxDKSB22ovMpSULbOL/QAQGPN6M0YMS3PubQvB0jVc4W7QP6VhasIVic7MzKcJSh0BAVs4J6SZjoH0lDDNlg==} engines: {node: '>=0.4.0'} - dev: true /flush-write-stream@1.1.1: resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==} @@ -36631,35 +36655,6 @@ packages: - utf-8-validate dev: true - /jest-cli@27.5.1: - resolution: {integrity: sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/core': 27.5.1 - '@jest/test-result': 27.5.1 - '@jest/types': 27.5.1 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.11 - import-local: 3.1.0 - jest-config: 27.5.1(ts-node@10.9.2) - jest-util: 27.5.1 - jest-validate: 27.5.1 - prompts: 2.4.2 - yargs: 16.2.0 - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - ts-node - - utf-8-validate - /jest-cli@27.5.1(ts-node@10.9.2): resolution: {integrity: sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -36688,7 +36683,6 @@ packages: - supports-color - ts-node - utf-8-validate - dev: true /jest-cli@29.7.0(@types/node@16.18.68)(ts-node@10.9.2): resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==} @@ -37678,7 +37672,7 @@ packages: jest: ^24.0.0 || ^25.0.0 || ^26.0.0 || ^27.0.0 typescript: ^3.0.0 || ^4.0.0 dependencies: - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) ts-essentials: 7.0.3(typescript@5.3.3) typescript: 5.3.3 dev: true @@ -38695,26 +38689,6 @@ packages: - utf-8-validate dev: true - /jest@27.5.1: - resolution: {integrity: sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/core': 27.5.1 - import-local: 3.1.0 - jest-cli: 27.5.1 - transitivePeerDependencies: - - bufferutil - - canvas - - supports-color - - ts-node - - utf-8-validate - /jest@27.5.1(ts-node@10.9.2): resolution: {integrity: sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} @@ -38734,7 +38708,6 @@ packages: - supports-color - ts-node - utf-8-validate - dev: true /jest@29.7.0(@types/node@16.18.68)(ts-node@10.9.2): resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==} @@ -38895,7 +38868,7 @@ packages: '@babel/register': 7.22.15(@babel/core@7.23.5) babel-core: 7.0.0-bridge.0(@babel/core@7.23.5) chalk: 4.1.2 - flow-parser: 0.206.0 + flow-parser: 0.223.3 graceful-fs: 4.2.11 micromatch: 4.0.5 neo-async: 2.6.2 @@ -43619,7 +43592,7 @@ packages: postcss: 8.4.32 schema-utils: 3.3.0 semver: 7.5.4 - webpack: 5.89.0(webpack-cli@5.1.4) + webpack: 5.89.0(webpack-cli@3.3.12) /postcss-loader@6.2.1(postcss@8.4.31)(webpack@5.88.2): resolution: {integrity: sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q==} @@ -45389,23 +45362,6 @@ packages: - supports-color - utf-8-validate - /puppeteer@21.6.0(typescript@5.3.3): - resolution: {integrity: sha512-u6JhSF7xaPYZ2gd3tvhYI8MwVAjLc3Cazj7UWvMV95A07/y7cIjBwYUiMU9/jm4z0FSUORriLX/RZRaiASNWPw==} - engines: {node: '>=16.13.2'} - hasBin: true - requiresBuild: true - dependencies: - '@puppeteer/browsers': 1.9.0 - cosmiconfig: 8.3.6(typescript@5.3.3) - puppeteer-core: 21.6.0 - transitivePeerDependencies: - - bufferutil - - encoding - - supports-color - - typescript - - utf-8-validate - dev: false - /pure-rand@6.0.4: resolution: {integrity: sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==} @@ -47660,7 +47616,7 @@ packages: sass: 1.69.5 schema-utils: 3.3.0 semver: 7.5.4 - webpack: 5.89.0(webpack-cli@5.1.4) + webpack: 5.89.0(webpack-cli@3.3.12) /sass-loader@12.6.0(sass@1.69.5)(webpack@5.88.2): resolution: {integrity: sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==} @@ -50410,7 +50366,7 @@ packages: babel-jest: 27.5.1(@babel/core@7.23.5) bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 27.5.1 + jest: 27.5.1(ts-node@10.9.2) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 From 8b6036a30e3cfdcc5b94e3f426c0465aa80b4f24 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 18:18:25 -0800 Subject: [PATCH 02/12] Changed Blocks Build Output --- .../.github/compare-assets/index.js | 2 +- .../woocommerce-blocks/bin/webpack-configs.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/woocommerce-blocks/.github/compare-assets/index.js b/plugins/woocommerce-blocks/.github/compare-assets/index.js index 4e68cf12a59..8876fe18dc1 100644 --- a/plugins/woocommerce-blocks/.github/compare-assets/index.js +++ b/plugins/woocommerce-blocks/.github/compare-assets/index.js @@ -20,7 +20,7 @@ const runner = async () => { return; } - const newAssets = require( '../../build/assets.json' ); + const newAssets = require( '../../../woocommerce/assets/client/blocks/assets.json' ); if ( ! newAssets ) { return; diff --git a/plugins/woocommerce-blocks/bin/webpack-configs.js b/plugins/woocommerce-blocks/bin/webpack-configs.js index 58e735fdf55..fe5e2edef2f 100644 --- a/plugins/woocommerce-blocks/bin/webpack-configs.js +++ b/plugins/woocommerce-blocks/bin/webpack-configs.js @@ -84,7 +84,7 @@ const getCoreConfig = ( options = {} ) => { filename: ( chunkData ) => { return `${ paramCase( chunkData.chunk.name ) }.js`; }, - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), library: [ 'wc', '[name]' ], libraryTarget: 'this', uniqueName: 'webpackWcBlocksJsonp', @@ -183,7 +183,7 @@ const getMainConfig = ( options = {} ) => { entry: getEntryConfig( 'main', options.exclude || [] ), output: { devtoolNamespace: 'wc', - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), // This is a cache busting mechanism which ensures that the script is loaded via the browser with a ?ver=hash // string. The hash is based on the built file contents. // @see https://github.com/webpack/webpack/issues/2329 @@ -317,7 +317,7 @@ const getFrontConfig = ( options = {} ) => { entry: getEntryConfig( 'frontend', options.exclude || [] ), output: { devtoolNamespace: 'wc', - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), // This is a cache busting mechanism which ensures that the script is loaded via the browser with a ?ver=hash // string. The hash is based on the built file contents. // @see https://github.com/webpack/webpack/issues/2329 @@ -442,7 +442,7 @@ const getPaymentsConfig = ( options = {} ) => { entry: getEntryConfig( 'payments', options.exclude || [] ), output: { devtoolNamespace: 'wc', - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), filename: `[name].js`, uniqueName: 'webpackWcBlocksPaymentMethodExtensionJsonp', }, @@ -549,7 +549,7 @@ const getExtensionsConfig = ( options = {} ) => { entry: getEntryConfig( 'extensions', options.exclude || [] ), output: { devtoolNamespace: 'wc', - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), filename: `[name].js`, uniqueName: 'webpackWcBlocksExtensionsMethodExtensionJsonp', }, @@ -656,7 +656,7 @@ const getSiteEditorConfig = ( options = {} ) => { entry: getEntryConfig( 'editor', options.exclude || [] ), output: { devtoolNamespace: 'wc', - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), filename: `[name].js`, chunkLoadingGlobal: 'webpackWcBlocksExtensionsMethodExtensionJsonp', }, @@ -763,7 +763,7 @@ const getStylingConfig = ( options = {} ) => { entry: getEntryConfig( 'styling', options.exclude || [] ), output: { devtoolNamespace: 'wc', - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), filename: `[name]-style${ fileSuffix }.js`, library: [ 'wc', 'blocks', '[name]' ], libraryTarget: 'this', @@ -914,7 +914,7 @@ const getInteractivityAPIConfig = ( options = {} ) => { }, output: { filename: '[name].js', - path: path.resolve( __dirname, '../build/' ), + path: path.resolve( __dirname, '../../woocommerce/assets/client/blocks/' ), library: [ 'wc', '__experimentalInteractivity' ], libraryTarget: 'this', chunkLoadingGlobal: 'webpackWcBlocksJsonp', From 389828ad7e88095d9223044ace008663191f365c Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 20:42:32 -0800 Subject: [PATCH 03/12] Fixed Blocks Autoloads --- plugins/woocommerce-blocks/tests/bootstrap.php | 2 +- plugins/woocommerce/composer.json | 6 +++++- plugins/woocommerce/composer.lock | 2 +- .../tests/php/src/Blocks/AI/ConnectionTest.php | 2 +- .../tests/php/src/Blocks/Assets/AssetDataRegistry.php | 4 ++-- .../woocommerce/tests/php/src/Blocks/BlockTypes/Cart.php | 4 ++-- .../tests/php/src/Blocks/BlockTypes/ProductCollection.php | 4 ++-- .../tests/php/src/Blocks/BlockTypes/ProductQuery.php | 4 ++-- .../tests/php/src/Blocks/Bootstrap/MainFile.php | 2 +- .../woocommerce/tests/php/src/Blocks/Domain/Package.php | 2 +- .../php/src/Blocks/Domain/Services/DeleteDraftOrders.php | 2 +- .../tests/php/src/Blocks/Helpers/FixtureData.php | 2 +- .../tests/php/src/Blocks/Helpers/TestValidateSchema.php | 2 +- .../tests/php/src/Blocks/Helpers/ValidateSchema.php | 2 +- plugins/woocommerce/tests/php/src/Blocks/Migration.php | 2 +- .../tests/php/src/Blocks/Registry/Container.php | 4 ++-- .../tests/php/src/Blocks/StoreApi/ControllerTests.php | 2 +- .../tests/php/src/Blocks/StoreApi/ExtendSchemaTests.php | 2 +- .../Blocks/StoreApi/Formatters/TestCurrencyFormatter.php | 2 +- .../php/src/Blocks/StoreApi/Formatters/TestFormatters.php | 2 +- .../src/Blocks/StoreApi/Formatters/TestHtmlFormatter.php | 2 +- .../src/Blocks/StoreApi/Formatters/TestMoneyFormatter.php | 2 +- .../tests/php/src/Blocks/StoreApi/RateLimitsTests.php | 2 +- .../tests/php/src/Blocks/StoreApi/Routes/Batch.php | 6 +++--- .../tests/php/src/Blocks/StoreApi/Routes/Cart.php | 6 +++--- .../tests/php/src/Blocks/StoreApi/Routes/CartCoupons.php | 8 ++++---- .../php/src/Blocks/StoreApi/Routes/CartExtensions.php | 6 +++--- .../tests/php/src/Blocks/StoreApi/Routes/CartItems.php | 8 ++++---- .../tests/php/src/Blocks/StoreApi/Routes/Checkout.php | 4 ++-- .../php/src/Blocks/StoreApi/Routes/ControllerTestCase.php | 2 +- .../src/Blocks/StoreApi/Routes/ProductAttributeTerms.php | 8 ++++---- .../php/src/Blocks/StoreApi/Routes/ProductAttributes.php | 8 ++++---- .../src/Blocks/StoreApi/Routes/ProductCollectionData.php | 8 ++++---- .../tests/php/src/Blocks/StoreApi/Routes/Products.php | 8 ++++---- .../php/src/Blocks/StoreApi/Utilities/CartController.php | 4 ++-- .../php/src/Blocks/StoreApi/Utilities/NoticeHandler.php | 2 +- .../php/src/Blocks/StoreApi/Utilities/OrderController.php | 2 +- .../src/Blocks/StoreApi/Utilities/ProductQueryFilters.php | 4 ++-- .../Templates/SingleProductTemplateCompatibilityTests.php | 2 +- .../src/Blocks/Templates/SingleProductTemplateTests.php | 2 +- .../tests/php/src/Blocks/Utils/BlockTemplateUtilsTest.php | 2 +- .../tests/php/src/Blocks/Utils/MiniCartUtilsTest.php | 2 +- .../tests/php/src/Blocks/mocks/AssetDataRegistry.php | 2 +- .../tests/php/src/Blocks/mocks/CartCheckoutUtilsMock.php | 2 +- .../tests/php/src/Blocks/mocks/MockTestDependency.php | 2 +- .../tests/php/src/Blocks/mocks/ProductCollectionMock.php | 2 +- .../tests/php/src/Blocks/mocks/ProductQueryMock.php | 2 +- 47 files changed, 83 insertions(+), 79 deletions(-) diff --git a/plugins/woocommerce-blocks/tests/bootstrap.php b/plugins/woocommerce-blocks/tests/bootstrap.php index e2f2c5aa291..59e1cc87afb 100644 --- a/plugins/woocommerce-blocks/tests/bootstrap.php +++ b/plugins/woocommerce-blocks/tests/bootstrap.php @@ -5,7 +5,7 @@ * @package WooCommerce Blocks */ -namespace Automattic\WooCommerce\Blocks\Tests; +namespace Automattic\WooCommerce\Tests\Blocks; // Require composer dependencies. require_once dirname( __DIR__ ) . '/vendor/autoload.php'; diff --git a/plugins/woocommerce/composer.json b/plugins/woocommerce/composer.json index f908db0a9aa..14959dbaa4b 100644 --- a/plugins/woocommerce/composer.json +++ b/plugins/woocommerce/composer.json @@ -67,7 +67,11 @@ }, "psr-0": { "Automattic\\WooCommerce\\Vendor\\": "lib/packages/" - } + }, + "files": [ + "src/StoreApi/deprecated.php", + "src/StoreApi/functions.php" + ] }, "autoload-dev": { "psr-4": { diff --git a/plugins/woocommerce/composer.lock b/plugins/woocommerce/composer.lock index 6ac6b080a64..8c5e6a7c39c 100644 --- a/plugins/woocommerce/composer.lock +++ b/plugins/woocommerce/composer.lock @@ -3808,7 +3808,7 @@ }, { "name": "woocommerce/monorepo-plugin", - "version": "dev-merge/move-blocks-php-and-assets", + "version": "dev-fix/block-library-build", "dist": { "type": "path", "url": "../../packages/php/monorepo-plugin", diff --git a/plugins/woocommerce/tests/php/src/Blocks/AI/ConnectionTest.php b/plugins/woocommerce/tests/php/src/Blocks/AI/ConnectionTest.php index f3cfbbccde6..da08e0e528f 100644 --- a/plugins/woocommerce/tests/php/src/Blocks/AI/ConnectionTest.php +++ b/plugins/woocommerce/tests/php/src/Blocks/AI/ConnectionTest.php @@ -5,7 +5,7 @@ * @package WooCommerce\AI\Tests */ -namespace Automattic\WooCommerce\Blocks\Tests\AI; +namespace Automattic\WooCommerce\Tests\Blocks\AI; use Automattic\WooCommerce\Blocks\AI\Connection; use \WP_UnitTestCase; diff --git a/plugins/woocommerce/tests/php/src/Blocks/Assets/AssetDataRegistry.php b/plugins/woocommerce/tests/php/src/Blocks/Assets/AssetDataRegistry.php index 7344817dcb6..6af8a6a8452 100644 --- a/plugins/woocommerce/tests/php/src/Blocks/Assets/AssetDataRegistry.php +++ b/plugins/woocommerce/tests/php/src/Blocks/Assets/AssetDataRegistry.php @@ -1,9 +1,9 @@ Date: Sat, 9 Dec 2023 21:02:46 -0800 Subject: [PATCH 04/12] Fixed Blocks Plugin Paths --- plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php | 2 +- plugins/woocommerce/src/Blocks/BlockTypes/Checkout.php | 2 +- plugins/woocommerce/src/Blocks/Package.php | 2 +- plugins/woocommerce/src/Blocks/Patterns/PatternsHelper.php | 2 +- plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php | 4 ++-- plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php b/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php index c4ef90ddfb2..571a927ea7a 100644 --- a/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php +++ b/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php @@ -429,7 +429,7 @@ abstract class AbstractBlock { 'wcBlocksConfig', [ 'buildPhase' => Package::feature()->get_flag(), - 'pluginUrl' => plugins_url( '/', dirname( __DIR__ ) ), + 'pluginUrl' => plugins_url( '/', dirname( __DIR__, 2 ) ), 'productCount' => array_sum( (array) wp_count_posts( 'product' ) ), 'restApiRoutes' => [ '/wc/store/v1' => array_keys( $this->get_routes_from_namespace( 'wc/store/v1' ) ), diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/Checkout.php b/plugins/woocommerce/src/Blocks/BlockTypes/Checkout.php index 9d1b7734e7d..e99f3fef072 100644 --- a/plugins/woocommerce/src/Blocks/BlockTypes/Checkout.php +++ b/plugins/woocommerce/src/Blocks/BlockTypes/Checkout.php @@ -353,7 +353,7 @@ class Checkout extends AbstractBlock { $declared_extensions['incompatible'], function( $acc, $item ) use ( $all_plugins ) { $plugin = $all_plugins[ $item ] ?? null; - $plugin_id = $plugin['TextDomain'] ?? dirname( $item ); + $plugin_id = $plugin['TextDomain'] ?? dirname( $item, 2 ); $plugin_name = $plugin['Name'] ?? $plugin_id; $acc[] = [ 'id' => $plugin_id, diff --git a/plugins/woocommerce/src/Blocks/Package.php b/plugins/woocommerce/src/Blocks/Package.php index 94a855975e8..d9d9ddccdf5 100644 --- a/plugins/woocommerce/src/Blocks/Package.php +++ b/plugins/woocommerce/src/Blocks/Package.php @@ -112,7 +112,7 @@ class Package { $version = '11.8.0-dev'; return new NewPackage( $version, - dirname( __DIR__ ), + dirname( __DIR__, 2 ), new FeatureGating() ); } diff --git a/plugins/woocommerce/src/Blocks/Patterns/PatternsHelper.php b/plugins/woocommerce/src/Blocks/Patterns/PatternsHelper.php index 87034417cf8..584da1bb9c4 100644 --- a/plugins/woocommerce/src/Blocks/Patterns/PatternsHelper.php +++ b/plugins/woocommerce/src/Blocks/Patterns/PatternsHelper.php @@ -66,7 +66,7 @@ class PatternsHelper { public static function get_image_url( array $images, int $index, string $default_image ): string { $image = filter_var( $default_image, FILTER_VALIDATE_URL ) ? $default_image - : plugins_url( $default_image, dirname( __DIR__ ) ); + : plugins_url( $default_image, dirname( __DIR__, 2 ) ); if ( isset( $images[ $index ] ) ) { $image = $images[ $index ]; diff --git a/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php b/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php index e504e160eea..b84668091a0 100644 --- a/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php +++ b/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php @@ -208,7 +208,7 @@ class ProductUpdater { require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; - $product_image_id = media_sideload_image( plugins_url( $product_data['image'], dirname( __DIR__ ) ), $product->get_id(), $product_data['title'], 'id' ); + $product_image_id = media_sideload_image( plugins_url( $product_data['image'], dirname( __DIR__, 2 ) ), $product->get_id(), $product_data['title'], 'id' ); if ( is_wp_error( $product_image_id ) ) { return new \WP_Error( 'error_uploading_image', $product_image_id->get_error_message() ); } @@ -495,7 +495,7 @@ class ProductUpdater { require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; - $product_image_id = media_sideload_image( plugins_url( self::DUMMY_PRODUCTS[ $i ]['image'], dirname( __DIR__ ) ), $product->get_id(), self::DUMMY_PRODUCTS[ $i ]['title'], 'id' ); + $product_image_id = media_sideload_image( plugins_url( self::DUMMY_PRODUCTS[ $i ]['image'], dirname( __DIR__, 2 ) ), $product->get_id(), self::DUMMY_PRODUCTS[ $i ]['title'], 'id' ); $product_image_id = $product->set_image_id( $product_image_id ); $product->save(); diff --git a/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php b/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php index 5b711b69350..70c5650bf3f 100644 --- a/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php +++ b/plugins/woocommerce/src/Blocks/Utils/BlockTemplateUtils.php @@ -293,7 +293,7 @@ class BlockTemplateUtils { * @return string */ public static function get_templates_directory( $template_type = 'wp_template' ) { - $root_path = dirname( __DIR__, 2 ) . '/' . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR; + $root_path = dirname( __DIR__, 3 ) . '/' . self::TEMPLATES_ROOT_DIR . DIRECTORY_SEPARATOR; $templates_directory = $root_path . self::DIRECTORY_NAMES['TEMPLATES']; $template_parts_directory = $root_path . self::DIRECTORY_NAMES['TEMPLATE_PARTS']; From 386d0db96942571f92ceb142e28e589fbb19fdd1 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:03:34 -0800 Subject: [PATCH 05/12] Fixed Blocks Dependency Check Since we've merged it into WooCommerce Core there's nothing for us to bother checking it against. --- .../src/Blocks/Domain/Bootstrap.php | 63 +++++-------------- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php b/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php index 4b40fd32ee6..a255178ed57 100644 --- a/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php +++ b/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php @@ -77,22 +77,20 @@ class Bootstrap { $this->package = $container->get( Package::class ); $this->migration = $container->get( Migration::class ); - if ( $this->has_core_dependencies() ) { - $this->init(); - /** - * Fires when the woocommerce blocks are loaded and ready to use. - * - * This hook is intended to be used as a safe event hook for when the plugin - * has been loaded, and all dependency requirements have been met. - * - * To ensure blocks are initialized, you must use the `woocommerce_blocks_loaded` - * hook instead of the `plugins_loaded` hook. This is because the functions - * hooked into plugins_loaded on the same priority load in an inconsistent and unpredictable manner. - * - * @since 2.5.0 - */ - do_action( 'woocommerce_blocks_loaded' ); - } + $this->init(); + /** + * Fires when the woocommerce blocks are loaded and ready to use. + * + * This hook is intended to be used as a safe event hook for when the plugin + * has been loaded, and all dependency requirements have been met. + * + * To ensure blocks are initialized, you must use the `woocommerce_blocks_loaded` + * hook instead of the `plugins_loaded` hook. This is because the functions + * hooked into plugins_loaded on the same priority load in an inconsistent and unpredictable manner. + * + * @since 2.5.0 + */ + do_action( 'woocommerce_blocks_loaded' ); } /** @@ -161,39 +159,6 @@ class Bootstrap { } } - /** - * Check core dependencies exist. - * - * @return boolean - */ - protected function has_core_dependencies() { - $has_needed_dependencies = class_exists( 'WooCommerce', false ); - if ( $has_needed_dependencies ) { - $plugin_data = \get_file_data( - $this->package->get_path( 'woocommerce-gutenberg-products-block.php' ), - [ - 'RequiredWCVersion' => 'WC requires at least', - ] - ); - if ( isset( $plugin_data['RequiredWCVersion'] ) && version_compare( \WC()->version, $plugin_data['RequiredWCVersion'], '<' ) ) { - $has_needed_dependencies = false; - add_action( - 'admin_notices', - function() { - if ( should_display_compatibility_notices() ) { - ?> -
-

-
- Date: Sat, 9 Dec 2023 21:15:57 -0800 Subject: [PATCH 06/12] Fixed Blocks Asset Paths --- plugins/woocommerce/src/Blocks/Assets/Api.php | 6 ++-- .../src/Blocks/Assets/AssetDataRegistry.php | 2 +- .../src/Blocks/AssetsController.php | 30 +++++++++---------- .../src/Blocks/BlockTypes/AbstractBlock.php | 2 +- .../src/Blocks/BlockTypes/MiniCart.php | 4 +-- .../src/Blocks/Domain/Bootstrap.php | 2 +- .../Domain/Services/GoogleAnalytics.php | 2 +- .../src/Blocks/Interactivity/scripts.php | 2 +- .../Payments/Integrations/BankTransfer.php | 2 +- .../Payments/Integrations/CashOnDelivery.php | 2 +- .../Blocks/Payments/Integrations/Cheque.php | 2 +- .../Blocks/Payments/Integrations/PayPal.php | 2 +- .../Blocks/Shipping/ShippingController.php | 2 +- .../tests/php/src/Blocks/Domain/Package.php | 8 ++--- 14 files changed, 34 insertions(+), 34 deletions(-) diff --git a/plugins/woocommerce/src/Blocks/Assets/Api.php b/plugins/woocommerce/src/Blocks/Assets/Api.php index da8374c523a..40262192272 100644 --- a/plugins/woocommerce/src/Blocks/Assets/Api.php +++ b/plugins/woocommerce/src/Blocks/Assets/Api.php @@ -108,7 +108,7 @@ class Api { * @return string|boolean False if metadata file is not found for the block. */ public function get_block_metadata_path( $block_name, $path = '' ) { - $path_to_metadata_from_plugin_root = $this->package->get_path( 'build/' . $path . $block_name . '/block.json' ); + $path_to_metadata_from_plugin_root = $this->package->get_path( 'assets/client/blocks/' . $path . $block_name . '/block.json' ); if ( ! file_exists( $path_to_metadata_from_plugin_root ) ) { return false; } @@ -284,7 +284,7 @@ class Api { * @param boolean $rtl Optional. Whether or not to register RTL styles. */ public function register_style( $handle, $relative_src, $deps = [], $media = 'all', $rtl = false ) { - $filename = str_replace( plugins_url( '/', __DIR__ ), '', $relative_src ); + $filename = str_replace( plugins_url( '/', dirname( __DIR__ ) ), '', $relative_src ); $src = $this->get_asset_url( $relative_src ); $ver = $this->get_file_version( $filename ); wp_register_style( $handle, $src, $deps, $ver, $media ); @@ -302,7 +302,7 @@ class Api { * @return string The generated path. */ public function get_block_asset_build_path( $filename, $type = 'js' ) { - return "build/$filename.$type"; + return "assets/client/blocks/$filename.$type"; } /** diff --git a/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php b/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php index f8fed09cc26..4bc59e0b34e 100644 --- a/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php +++ b/plugins/woocommerce/src/Blocks/Assets/AssetDataRegistry.php @@ -373,7 +373,7 @@ class AssetDataRegistry { public function register_data_script() { $this->api->register_script( $this->handle, - 'build/wc-settings.js', + 'assets/client/blocks/wc-settings.js', [ 'wp-api-fetch' ], true ); diff --git a/plugins/woocommerce/src/Blocks/AssetsController.php b/plugins/woocommerce/src/Blocks/AssetsController.php index 7e81b6e948a..2e95c5e3fcc 100644 --- a/plugins/woocommerce/src/Blocks/AssetsController.php +++ b/plugins/woocommerce/src/Blocks/AssetsController.php @@ -46,26 +46,26 @@ final class AssetsController { * Register block scripts & styles. */ public function register_assets() { - $this->register_style( 'wc-blocks-packages-style', plugins_url( $this->api->get_block_asset_build_path( 'packages-style', 'css' ), __DIR__ ), [], 'all', true ); - $this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks', 'css' ), __DIR__ ), [], 'all', true ); - $this->register_style( 'wc-blocks-editor-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-editor-style', 'css' ), __DIR__ ), [ 'wp-edit-blocks' ], 'all', true ); + $this->register_style( 'wc-blocks-packages-style', plugins_url( $this->api->get_block_asset_build_path( 'packages-style', 'css' ), dirname( __DIR__ ) ), [], 'all', true ); + $this->register_style( 'wc-blocks-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks', 'css' ), dirname( __DIR__ ) ), [], 'all', true ); + $this->register_style( 'wc-blocks-editor-style', plugins_url( $this->api->get_block_asset_build_path( 'wc-blocks-editor-style', 'css' ), dirname( __DIR__ ) ), [ 'wp-edit-blocks' ], 'all', true ); - $this->api->register_script( 'wc-blocks-middleware', 'build/wc-blocks-middleware.js', [], false ); - $this->api->register_script( 'wc-blocks-data-store', 'build/wc-blocks-data.js', [ 'wc-blocks-middleware' ] ); + $this->api->register_script( 'wc-blocks-middleware', 'assets/client/blocks/wc-blocks-middleware.js', [], false ); + $this->api->register_script( 'wc-blocks-data-store', 'assets/client/blocks/wc-blocks-data.js', [ 'wc-blocks-middleware' ] ); $this->api->register_script( 'wc-blocks-vendors', $this->api->get_block_asset_build_path( 'wc-blocks-vendors' ), [], false ); - $this->api->register_script( 'wc-blocks-registry', 'build/wc-blocks-registry.js', [], false ); + $this->api->register_script( 'wc-blocks-registry', 'assets/client/blocks/wc-blocks-registry.js', [], false ); $this->api->register_script( 'wc-blocks', $this->api->get_block_asset_build_path( 'wc-blocks' ), [ 'wc-blocks-vendors' ], false ); - $this->api->register_script( 'wc-blocks-shared-context', 'build/wc-blocks-shared-context.js' ); - $this->api->register_script( 'wc-blocks-shared-hocs', 'build/wc-blocks-shared-hocs.js', [], false ); + $this->api->register_script( 'wc-blocks-shared-context', 'assets/client/blocks/wc-blocks-shared-context.js' ); + $this->api->register_script( 'wc-blocks-shared-hocs', 'assets/client/blocks/wc-blocks-shared-hocs.js', [], false ); // The price package is shared externally so has no blocks prefix. - $this->api->register_script( 'wc-price-format', 'build/price-format.js', [], false ); + $this->api->register_script( 'wc-price-format', 'assets/client/blocks/price-format.js', [], false ); - $this->api->register_script( 'wc-blocks-checkout', 'build/blocks-checkout.js', [] ); - $this->api->register_script( 'wc-blocks-components', 'build/blocks-components.js', [] ); + $this->api->register_script( 'wc-blocks-checkout', 'assets/client/blocks/blocks-checkout.js', [] ); + $this->api->register_script( 'wc-blocks-components', 'assets/client/blocks/blocks-components.js', [] ); // Register the interactivity components here for now. - $this->api->register_script( 'wc-interactivity-dropdown', 'build/wc-interactivity-dropdown.js', [] ); + $this->api->register_script( 'wc-interactivity-dropdown', 'assets/client/blocks/wc-interactivity-dropdown.js', [] ); wp_add_inline_script( 'wc-blocks-middleware', @@ -83,8 +83,8 @@ final class AssetsController { * Register and enqueue assets for exclusive usage within the Site Editor. */ public function register_and_enqueue_site_editor_assets() { - $this->api->register_script( 'wc-blocks-classic-template-revert-button', 'build/wc-blocks-classic-template-revert-button.js' ); - $this->api->register_style( 'wc-blocks-classic-template-revert-button-style', 'build/wc-blocks-classic-template-revert-button-style.css' ); + $this->api->register_script( 'wc-blocks-classic-template-revert-button', 'assets/client/blocks/wc-blocks-classic-template-revert-button.js' ); + $this->api->register_style( 'wc-blocks-classic-template-revert-button-style', 'assets/client/blocks/wc-blocks-classic-template-revert-button-style.css' ); $current_screen = get_current_screen(); if ( $current_screen instanceof \WP_Screen && 'site-editor' === $current_screen->base ) { @@ -290,7 +290,7 @@ final class AssetsController { * @param boolean $rtl Optional. Whether or not to register RTL styles. */ protected function register_style( $handle, $src, $deps = [], $media = 'all', $rtl = false ) { - $filename = str_replace( plugins_url( '/', __DIR__ ), '', $src ); + $filename = str_replace( plugins_url( '/', dirname( __DIR__ ) ), '', $src ); $ver = self::get_file_version( $filename ); wp_register_style( $handle, $src, $deps, $ver, $media ); diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php b/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php index 571a927ea7a..f89d97c21f8 100644 --- a/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php +++ b/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php @@ -180,7 +180,7 @@ abstract class AbstractBlock { * @return string[] $chunks list of chunks to load. */ protected function get_chunks_paths( $chunks_folder ) { - $build_path = \Automattic\WooCommerce\Blocks\Package::get_path() . 'build/'; + $build_path = \Automattic\WooCommerce\Blocks\Package::get_path() . 'assets/client/blocks/'; $blocks = []; if ( ! is_dir( $build_path . $chunks_folder ) ) { return []; diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/MiniCart.php b/plugins/woocommerce/src/Blocks/BlockTypes/MiniCart.php index ae929ee084d..27be4c70c1f 100644 --- a/plugins/woocommerce/src/Blocks/BlockTypes/MiniCart.php +++ b/plugins/woocommerce/src/Blocks/BlockTypes/MiniCart.php @@ -206,7 +206,7 @@ class MiniCart extends AbstractBlock { * Prints the variable containing information about the scripts to lazy load. */ public function print_lazy_load_scripts() { - $script_data = $this->asset_api->get_script_data( 'build/mini-cart-component-frontend.js' ); + $script_data = $this->asset_api->get_script_data( 'assets/client/blocks/mini-cart-component-frontend.js' ); $num_dependencies = is_countable( $script_data['dependencies'] ) ? count( $script_data['dependencies'] ) : 0; $wp_scripts = wp_scripts(); @@ -261,7 +261,7 @@ class MiniCart extends AbstractBlock { ); } foreach ( $inner_blocks_frontend_scripts as $inner_block_frontend_script ) { - $script_data = $this->asset_api->get_script_data( 'build/mini-cart-contents-block/' . $inner_block_frontend_script . '.js' ); + $script_data = $this->asset_api->get_script_data( 'assets/client/blocks/mini-cart-contents-block/' . $inner_block_frontend_script . '.js' ); $this->scripts_to_lazy_load[ 'wc-block-' . $inner_block_frontend_script ] = array( 'src' => $script_data['src'], 'version' => $script_data['version'], diff --git a/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php b/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php index a255178ed57..d37d40cd6c8 100644 --- a/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php +++ b/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php @@ -166,7 +166,7 @@ class Bootstrap { */ protected function is_built() { return file_exists( - $this->package->get_path( 'build/featured-product.js' ) + $this->package->get_path( 'assets/client/blocks/featured-product.js' ) ); } diff --git a/plugins/woocommerce/src/Blocks/Domain/Services/GoogleAnalytics.php b/plugins/woocommerce/src/Blocks/Domain/Services/GoogleAnalytics.php index 1123cd52016..91e297836b3 100644 --- a/plugins/woocommerce/src/Blocks/Domain/Services/GoogleAnalytics.php +++ b/plugins/woocommerce/src/Blocks/Domain/Services/GoogleAnalytics.php @@ -41,7 +41,7 @@ class GoogleAnalytics { * Register scripts. */ public function register_assets() { - $this->asset_api->register_script( 'wc-blocks-google-analytics', 'build/wc-blocks-google-analytics.js', [ 'google-tag-manager' ] ); + $this->asset_api->register_script( 'wc-blocks-google-analytics', 'assets/client/blocks/wc-blocks-google-analytics.js', [ 'google-tag-manager' ] ); } /** diff --git a/plugins/woocommerce/src/Blocks/Interactivity/scripts.php b/plugins/woocommerce/src/Blocks/Interactivity/scripts.php index 7b48834807c..4da1cd57cb9 100644 --- a/plugins/woocommerce/src/Blocks/Interactivity/scripts.php +++ b/plugins/woocommerce/src/Blocks/Interactivity/scripts.php @@ -28,7 +28,7 @@ function woocommerce_interactivity_register_runtime() { $plugin_path = \Automattic\WooCommerce\Blocks\Package::get_path(); $plugin_url = plugin_dir_url( $plugin_path . '/index.php' ); - $file = 'build/wc-interactivity.js'; + $file = 'assets/client/blocks/wc-interactivity.js'; $file_path = $plugin_path . $file; $file_url = $plugin_url . $file; diff --git a/plugins/woocommerce/src/Blocks/Payments/Integrations/BankTransfer.php b/plugins/woocommerce/src/Blocks/Payments/Integrations/BankTransfer.php index 8572fdbc2e0..af8c867096d 100644 --- a/plugins/woocommerce/src/Blocks/Payments/Integrations/BankTransfer.php +++ b/plugins/woocommerce/src/Blocks/Payments/Integrations/BankTransfer.php @@ -56,7 +56,7 @@ final class BankTransfer extends AbstractPaymentMethodType { public function get_payment_method_script_handles() { $this->asset_api->register_script( 'wc-payment-method-bacs', - 'build/wc-payment-method-bacs.js' + 'assets/client/blocks/wc-payment-method-bacs.js' ); return [ 'wc-payment-method-bacs' ]; } diff --git a/plugins/woocommerce/src/Blocks/Payments/Integrations/CashOnDelivery.php b/plugins/woocommerce/src/Blocks/Payments/Integrations/CashOnDelivery.php index 5822732464e..c01e9c8a483 100644 --- a/plugins/woocommerce/src/Blocks/Payments/Integrations/CashOnDelivery.php +++ b/plugins/woocommerce/src/Blocks/Payments/Integrations/CashOnDelivery.php @@ -79,7 +79,7 @@ final class CashOnDelivery extends AbstractPaymentMethodType { public function get_payment_method_script_handles() { $this->asset_api->register_script( 'wc-payment-method-cod', - 'build/wc-payment-method-cod.js' + 'assets/client/blocks/wc-payment-method-cod.js' ); return [ 'wc-payment-method-cod' ]; } diff --git a/plugins/woocommerce/src/Blocks/Payments/Integrations/Cheque.php b/plugins/woocommerce/src/Blocks/Payments/Integrations/Cheque.php index 318f6c84b44..76b8339c3aa 100644 --- a/plugins/woocommerce/src/Blocks/Payments/Integrations/Cheque.php +++ b/plugins/woocommerce/src/Blocks/Payments/Integrations/Cheque.php @@ -57,7 +57,7 @@ final class Cheque extends AbstractPaymentMethodType { public function get_payment_method_script_handles() { $this->asset_api->register_script( 'wc-payment-method-cheque', - 'build/wc-payment-method-cheque.js' + 'assets/client/blocks/wc-payment-method-cheque.js' ); return [ 'wc-payment-method-cheque' ]; } diff --git a/plugins/woocommerce/src/Blocks/Payments/Integrations/PayPal.php b/plugins/woocommerce/src/Blocks/Payments/Integrations/PayPal.php index 6becf7f81f3..21893647654 100644 --- a/plugins/woocommerce/src/Blocks/Payments/Integrations/PayPal.php +++ b/plugins/woocommerce/src/Blocks/Payments/Integrations/PayPal.php @@ -57,7 +57,7 @@ final class PayPal extends AbstractPaymentMethodType { public function get_payment_method_script_handles() { $this->asset_api->register_script( 'wc-payment-method-paypal', - 'build/wc-payment-method-paypal.js' + 'assets/client/blocks/wc-payment-method-paypal.js' ); return [ 'wc-payment-method-paypal' ]; } diff --git a/plugins/woocommerce/src/Blocks/Shipping/ShippingController.php b/plugins/woocommerce/src/Blocks/Shipping/ShippingController.php index a931b2881a3..087fa10315d 100644 --- a/plugins/woocommerce/src/Blocks/Shipping/ShippingController.php +++ b/plugins/woocommerce/src/Blocks/Shipping/ShippingController.php @@ -349,7 +349,7 @@ class ShippingController { * Load admin scripts. */ public function admin_scripts() { - $this->asset_api->register_script( 'wc-shipping-method-pickup-location', 'build/wc-shipping-method-pickup-location.js', [], true ); + $this->asset_api->register_script( 'wc-shipping-method-pickup-location', 'assets/client/blocks/wc-shipping-method-pickup-location.js', [], true ); } /** diff --git a/plugins/woocommerce/tests/php/src/Blocks/Domain/Package.php b/plugins/woocommerce/tests/php/src/Blocks/Domain/Package.php index 9bee03319ab..0849bb289b6 100644 --- a/plugins/woocommerce/tests/php/src/Blocks/Domain/Package.php +++ b/plugins/woocommerce/tests/php/src/Blocks/Domain/Package.php @@ -27,8 +27,8 @@ class Package extends WP_UnitTestCase { $this->assertEquals( __DIR__ . '/', $package->get_path() ); //test with relative - $expect = __DIR__ . '/build/test'; - $this->assertEquals( $expect, $package->get_path( 'build/test') ); + $expect = __DIR__ . '/assets/client/blocks/test'; + $this->assertEquals( $expect, $package->get_path( 'assets/client/blocks/test') ); } public function test_get_url() { @@ -39,8 +39,8 @@ class Package extends WP_UnitTestCase { //test with relative $this->assertEquals( - $test_url . 'build/test', - $package->get_url( 'build/test' ) + $test_url . 'assets/client/blocks', + $package->get_url( 'assets/client/blocks' ) ); } } From cf357e809bbe920120e3514afd0f6aa05773568a Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:20:21 -0800 Subject: [PATCH 07/12] Fixed Blocks Asset Constant Path --- .../woocommerce-blocks/assets/js/settings/blocks/constants.ts | 2 +- plugins/woocommerce/src/Blocks/Assets/Api.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts b/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts index 8436f26424c..050bb21c3f4 100644 --- a/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts +++ b/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts @@ -31,7 +31,7 @@ export const blocksConfig = getSetting( 'wcBlocksConfig', { } ) as WcBlocksConfig; export const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'images/'; -export const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'build/'; +export const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'assets/client/blocks/'; export const WC_BLOCKS_PHASE = blocksConfig.buildPhase; export const SHOP_URL = STORE_PAGES.shop?.permalink; export const CHECKOUT_PAGE_ID = STORE_PAGES.checkout?.id; diff --git a/plugins/woocommerce/src/Blocks/Assets/Api.php b/plugins/woocommerce/src/Blocks/Assets/Api.php index 40262192272..98db199a866 100644 --- a/plugins/woocommerce/src/Blocks/Assets/Api.php +++ b/plugins/woocommerce/src/Blocks/Assets/Api.php @@ -103,7 +103,7 @@ class Api { * Get the path to a block's metadata * * @param string $block_name The block to get metadata for. - * @param string $path Optional. The path to the metadata file inside the 'build' folder. + * @param string $path Optional. The path to the metadata file inside the 'assets/client/blocks' folder. * * @return string|boolean False if metadata file is not found for the block. */ From e34361695d79b206517159421053a84467961ffb Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:26:49 -0800 Subject: [PATCH 08/12] Fixed Image Asset Paths --- .../assets/js/settings/blocks/constants.ts | 2 +- .../src/Blocks/Patterns/ProductUpdater.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts b/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts index 050bb21c3f4..4977a06f019 100644 --- a/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts +++ b/plugins/woocommerce-blocks/assets/js/settings/blocks/constants.ts @@ -30,7 +30,7 @@ export const blocksConfig = getSetting( 'wcBlocksConfig', { wordCountType: 'words', } ) as WcBlocksConfig; -export const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'images/'; +export const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'assets/images/'; export const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'assets/client/blocks/'; export const WC_BLOCKS_PHASE = blocksConfig.buildPhase; export const SHOP_URL = STORE_PAGES.shop?.permalink; diff --git a/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php b/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php index b84668091a0..d656037a670 100644 --- a/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php +++ b/plugins/woocommerce/src/Blocks/Patterns/ProductUpdater.php @@ -11,37 +11,37 @@ class ProductUpdater { const DUMMY_PRODUCTS = [ [ 'title' => 'Vintage Typewriter', - 'image' => 'images/pattern-placeholders/writing-typing-keyboard-technology-white-vintage.jpg', + 'image' => 'assets/images/pattern-placeholders/writing-typing-keyboard-technology-white-vintage.jpg', 'description' => 'A hit spy novel or a love letter? Anything you type using this vintage typewriter from the 20s is bound to make a mark.', 'price' => 90, ], [ 'title' => 'Leather-Clad Leisure Chair', - 'image' => 'images/pattern-placeholders/table-wood-house-chair-floor-window.jpg', + 'image' => 'assets/images/pattern-placeholders/table-wood-house-chair-floor-window.jpg', 'description' => 'Sit back and relax in this comfy designer chair. High-grain leather and steel frame add luxury to your your leisure.', 'price' => 249, ], [ 'title' => 'Black and White Summer Portrait', - 'image' => 'images/pattern-placeholders/white-black-black-and-white-photograph-monochrome-photography.jpg', + 'image' => 'assets/images/pattern-placeholders/white-black-black-and-white-photograph-monochrome-photography.jpg', 'description' => 'This 24" x 30" high-quality print just exudes summer. Hang it on the wall and forget about the world outside.', 'price' => 115, ], [ 'title' => '3-Speed Bike', - 'image' => 'images/pattern-placeholders/road-sport-vintage-wheel-retro-old.jpg', + 'image' => 'assets/images/pattern-placeholders/road-sport-vintage-wheel-retro-old.jpg', 'description' => 'Zoom through the streets on this premium 3-speed bike. Manufactured and assembled in Germany in the 80s.', 'price' => 115, ], [ 'title' => 'Hi-Fi Headphones', - 'image' => 'images/pattern-placeholders/man-person-music-black-and-white-white-photography.jpg', + 'image' => 'assets/images/pattern-placeholders/man-person-music-black-and-white-white-photography.jpg', 'description' => 'Experience your favorite songs in a new way with these premium hi-fi headphones.', 'price' => 125, ], [ 'title' => 'Retro Glass Jug (330 ml)', - 'image' => 'images/pattern-placeholders/drinkware-liquid-tableware-dishware-bottle-fluid.jpg', + 'image' => 'assets/images/pattern-placeholders/drinkware-liquid-tableware-dishware-bottle-fluid.jpg', 'description' => 'Thick glass and a classic silhouette make this jug a must-have for any retro-inspired kitchen.', 'price' => 115, ], From b4fd0c3b7b6d928baf8282ac3b231b3c072dfc29 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:33:34 -0800 Subject: [PATCH 09/12] Fixed Blocks INI File Path --- plugins/woocommerce-blocks/bin/webpack-configs.js | 2 +- plugins/woocommerce/.gitignore | 1 + .../src/Blocks/Domain/Services/FeatureGating.php | 12 ++++++------ plugins/woocommerce/woocommerce.php | 4 ++++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/woocommerce-blocks/bin/webpack-configs.js b/plugins/woocommerce-blocks/bin/webpack-configs.js index fe5e2edef2f..444672dee96 100644 --- a/plugins/woocommerce-blocks/bin/webpack-configs.js +++ b/plugins/woocommerce-blocks/bin/webpack-configs.js @@ -117,7 +117,7 @@ const getCoreConfig = ( options = {} ) => { ...getSharedPlugins( { bundleAnalyzerReportTitle: 'Core' } ), new ProgressBarPlugin( getProgressBarPluginConfig( 'Core' ) ), new CreateFileWebpack( { - path: './', + path: '../woocommerce', // file name fileName: 'blocks.ini', // content of the file diff --git a/plugins/woocommerce/.gitignore b/plugins/woocommerce/.gitignore index d0e09157ebd..b97ec12355e 100644 --- a/plugins/woocommerce/.gitignore +++ b/plugins/woocommerce/.gitignore @@ -4,6 +4,7 @@ # Built JS /assets/js/* /assets/client/* +/blocks.ini # Behat/CLI Tests tests/cli/installer diff --git a/plugins/woocommerce/src/Blocks/Domain/Services/FeatureGating.php b/plugins/woocommerce/src/Blocks/Domain/Services/FeatureGating.php index 581e6aecd32..799ebee71e0 100644 --- a/plugins/woocommerce/src/Blocks/Domain/Services/FeatureGating.php +++ b/plugins/woocommerce/src/Blocks/Domain/Services/FeatureGating.php @@ -49,9 +49,9 @@ class FeatureGating { public function load_flag() { if ( 0 === $this->flag ) { $default_flag = defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ? self::FEATURE_PLUGIN_FLAG : self::CORE_FLAG; - if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) { + if ( file_exists( __DIR__ . '/../../../../blocks.ini' ) ) { $allowed_flags = [ self::EXPERIMENTAL_FLAG, self::FEATURE_PLUGIN_FLAG, self::CORE_FLAG ]; - $woo_options = parse_ini_file( __DIR__ . '/../../../blocks.ini' ); + $woo_options = parse_ini_file( __DIR__ . '/../../../../blocks.ini' ); $this->flag = is_array( $woo_options ) && in_array( intval( $woo_options['woocommerce_blocks_phase'] ), $allowed_flags, true ) ? $woo_options['woocommerce_blocks_phase'] : $default_flag; } else { $this->flag = $default_flag; @@ -64,9 +64,9 @@ class FeatureGating { */ public function load_environment() { if ( 'unset' === $this->environment ) { - if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) { + if ( file_exists( __DIR__ . '/../../../../blocks.ini' ) ) { $allowed_environments = [ self::PRODUCTION_ENVIRONMENT, self::DEVELOPMENT_ENVIRONMENT, self::TEST_ENVIRONMENT ]; - $woo_options = parse_ini_file( __DIR__ . '/../../../blocks.ini' ); + $woo_options = parse_ini_file( __DIR__ . '/../../../../blocks.ini' ); $this->environment = is_array( $woo_options ) && in_array( $woo_options['woocommerce_blocks_env'], $allowed_environments, true ) ? $woo_options['woocommerce_blocks_env'] : self::PRODUCTION_ENVIRONMENT; } else { $this->environment = self::PRODUCTION_ENVIRONMENT; @@ -171,8 +171,8 @@ class FeatureGating { * @return boolean */ public function is_block_templates_controller_refactor_enabled() { - if ( file_exists( __DIR__ . '/../../../blocks.ini' ) ) { - $conf = parse_ini_file( __DIR__ . '/../../../blocks.ini' ); + if ( file_exists( __DIR__ . '/../../../../blocks.ini' ) ) { + $conf = parse_ini_file( __DIR__ . '/../../../../blocks.ini' ); return $this->is_development_environment() && isset( $conf['use_block_templates_controller_refactor'] ) && true === (bool) $conf['use_block_templates_controller_refactor']; } return false; diff --git a/plugins/woocommerce/woocommerce.php b/plugins/woocommerce/woocommerce.php index 7eedfa62a69..6fc6ad5eaa2 100644 --- a/plugins/woocommerce/woocommerce.php +++ b/plugins/woocommerce/woocommerce.php @@ -20,6 +20,10 @@ if ( ! defined( 'WC_PLUGIN_FILE' ) ) { define( 'WC_PLUGIN_FILE', __FILE__ ); } +if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) { + define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true ); +} + // Load core packages and the autoloader. require __DIR__ . '/src/Autoloader.php'; require __DIR__ . '/src/Packages.php'; From 6d57e59ad405af1015698c126eb8eb66700bf8c2 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:39:19 -0800 Subject: [PATCH 10/12] Corrected Blocks Readme --- plugins/woocommerce-blocks/README.md | 41 +--------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/plugins/woocommerce-blocks/README.md b/plugins/woocommerce-blocks/README.md index 78aba52ee6b..315bf2bbf36 100644 --- a/plugins/woocommerce-blocks/README.md +++ b/plugins/woocommerce-blocks/README.md @@ -1,25 +1,11 @@ # WooCommerce Blocks -[![Latest Tag](https://img.shields.io/github/tag/woocommerce/woocommerce-gutenberg-products-block.svg?style=flat&label=Latest%20Tag)](https://github.com/woocommerce/woocommerce-gutenberg-products-block/releases) -[![View](https://img.shields.io/badge/Project%20Components-brightgreen.svg?style=flat)](https://woocommerce.github.io/woocommerce-blocks/) -![JavaScript and CSS Linting](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/JavaScript%20and%20CSS%20Linting/badge.svg?branch=trunk) -![PHP Coding Standards](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/PHP%20Coding%20Standards/badge.svg?branch=trunk) -![Unit Tests](https://github.com/woocommerce/woocommerce-blocks/workflows/E2E%20tests/badge.svg?branch=trunk) -![E2E Tests](https://github.com/woocommerce/woocommerce-blocks/workflows/Unit%20Tests/badge.svg?branch=trunk) - -This is the feature plugin for WooCommerce + the Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor. - -Use this plugin if you want access to the bleeding edge of available blocks for WooCommerce. However, stable blocks are bundled into WooCommerce, and can be added from the "WooCommerce" section in the block inserter. - -- [WCCOM product page](https://woocommerce.com/products/woocommerce-gutenberg-products-block/) -- [User documentation](https://docs.woocommerce.com/document/woocommerce-blocks/) +This is the client for WooCommerce + the Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor. ## Table of Contents - [Documentation](#documentation) - [Code Documentation](#code-documentation) -- [Installing the plugin version](#installing-the-plugin-version) -- [Installing the development version](#installing-the-development-version) - [Getting started with block development](#getting-started-with-block-development) - [Long-term vision](#long-term-vision) @@ -36,31 +22,6 @@ If you want to see what we're working on for future versions, or want to help ou - [WooCommerce Blocks Handbook](./docs) - Documentation for designers and developers on how to extend or contribute to blocks, and how internal developers should handle new releases. - [WooCommerce Blocks Storybook](https://woocommerce.github.io/woocommerce-blocks/) - Contains a list and demo of components used in the plugin. -## Installing the plugin version - -We release a new version of WooCommerce Blocks onto WordPress.org every few weeks, which can be used as an easier way to preview the features. - -> Note: The plugin follows a policy of supporting the "L0" strategy for version support. What this means is that the plugin will require the most recent version of WordPress. It will also require the most recent version of WooCommerce core at the time of a release. You can read more about [this policy here](https://developer.woocommerce.com/?p=9998). - -1.Ensure you have the latest available versions of WordPress and WooCommerce installed on your site. -2. The plugin version is available on WordPress.org. [Download the plugin version here.](https://wordpress.org/plugins/woo-gutenberg-products-block/) -3. Activate the plugin. - -## Installing the development version - -1. Ensure you have the latest versions of WordPress and WooCommerce installed on your site. -2. Get a copy of this plugin using the green "Clone or download" button on the right. -3. Make sure you're using Node.js v16.15. If you use a Node version management tool such as `nvm` or `n`, you can do so by running `nvm use` or `n auto`, respectively. -4. `npm install` to install the dependencies. -5. `composer install` to install core dependencies. -6. To compile the code, run any of the following commands - 1. `npm run build` (production build). - 2. `npm run dev` (development build). - 3. `npm start` (development build + watching for changes). -7. Activate the plugin. - -The source code is in the `assets/` folder, and the compiled code is stored into `build/`. - ## Getting started with block development Run through the ["Writing Your First Block Type" tutorial](https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/writing-your-first-block-type/) for a quick course in block-building. From 4c0cc805dc85a67757cdc9f52acd7311a77e580b Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:40:52 -0800 Subject: [PATCH 11/12] Removed Old Docs Links --- plugins/woocommerce-blocks/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/woocommerce-blocks/README.md b/plugins/woocommerce-blocks/README.md index 315bf2bbf36..d7d86159ec8 100644 --- a/plugins/woocommerce-blocks/README.md +++ b/plugins/woocommerce-blocks/README.md @@ -1,6 +1,6 @@ # WooCommerce Blocks -This is the client for WooCommerce + the Gutenberg. This plugin serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor. +This is the client for WooCommerce + the Gutenberg. This package serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor. ## Table of Contents @@ -28,8 +28,6 @@ Run through the ["Writing Your First Block Type" tutorial](https://developer.wor For deeper dive, try looking at the [core blocks code,](https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src) or see what [components are available.](https://github.com/WordPress/gutenberg/tree/master/packages/components/src) -To begin contributing to the WooCommerce Blocks plugin, see our [getting started guide](./docs/contributors/getting-started.md) and [developer handbook](./docs/README.md). - Other useful docs to explore: - [`InnerBlocks`](https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md) From 5ff9c477aa1afbdabe7827c89c5a9c0e260f6eb7 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Sat, 9 Dec 2023 21:42:59 -0800 Subject: [PATCH 12/12] Updated Documentation --- plugins/woocommerce-blocks/README.md | 2 +- plugins/woocommerce/README.md | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-blocks/README.md b/plugins/woocommerce-blocks/README.md index d7d86159ec8..785d6d749f6 100644 --- a/plugins/woocommerce-blocks/README.md +++ b/plugins/woocommerce-blocks/README.md @@ -1,6 +1,6 @@ # WooCommerce Blocks -This is the client for WooCommerce + the Gutenberg. This package serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor. +This is the client for WooCommerce + Gutenberg. This package serves as a space to iterate and explore new Blocks and updates to existing blocks for WooCommerce, and how WooCommerce might work with the block editor. ## Table of Contents diff --git a/plugins/woocommerce/README.md b/plugins/woocommerce/README.md index 0c5d2da5b85..b475a04e0e7 100644 --- a/plugins/woocommerce/README.md +++ b/plugins/woocommerce/README.md @@ -54,6 +54,19 @@ pnpm run --filter=woocommerce/client/admin lint pnpm run --filter=woocommerce/client/admin test ``` +### `plugins/woocommerce-blocks` + +This directory contains the client for WooCommerce + Gutenberg. + +```bash +# Build the Blocks client. +pnpm run --filter=@woocommerce/block-library build +# Lint the Blocks client. +pnpm run --filter=@woocommerce/block-library lint +# Test the Blocks client. +pnpm run --filter=@woocommerce/block-library test +``` + #### Helper Scripts Here is a collection of scripts that can help when developing the React-based admin interface.