Skip to content

Commit 40df182

Browse files
committed
update packages
1 parent 561cf10 commit 40df182

File tree

14 files changed

+167
-156
lines changed

14 files changed

+167
-156
lines changed

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ hookdoc-conf.json
1313
package.json
1414
yarn.lock
1515
php-scoper
16+
generate_autoload.php

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ yarn.lock
3030
hookdocs
3131
*.cache
3232
phpunit.xml
33+
tests/logs/junit.xml

.phpunit.xml.dist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
</whitelist>
2020
</filter>
2121
<logging>
22-
<log type="coverage-clover" target="coverage/clover.xml" />
23-
</logging>
22+
<log type="coverage-clover" target="coverage/clover.xml" />
23+
<log type="junit" target="tests/logs/junit.xml" />
24+
</logging>
2425
</phpunit>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<img src="https://github.com/wcpos/woocommerce-pos/actions/workflows/wporg-deploy.yml/badge.svg" alt="Deploy to WordPress.org" />
1616
</a>
1717
<a href="https://wcpos.com/discord">
18-
<img src="https://img.shields.io/discord/711884517081612298?color=%237289DA&label=WCPOS&logo=discord&logoColor=white" alt="Discord chat" />
18+
<img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdiscord.com%2Fapi%2Finvites%2FGCEeEVpEvX%3Fwith_counts%3Dtrue&query=%24.approximate_presence_count&logo=discord&logoColor=white&label=users%20online&color=green" alt="Discord chat" />
1919
</a>
2020
</p>
2121
<p>

includes/API/Customers_Controller.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -313,21 +313,21 @@ public function wcpos_get_all_posts( $request ) {
313313
}
314314
}
315315
} else {
316-
function format_results( $users, $last_updates, $id_with_modified_date ) {
317-
foreach ( $users as $user ) {
318-
$user_info = array( 'id' => (int) $user->ID );
319-
if ( $id_with_modified_date ) {
320-
if ( isset( $last_updates[ $user->ID ] ) && ! empty( $last_updates[ $user->ID ] ) ) {
321-
$user_info['date_modified_gmt'] = $last_updates[ $user->ID ];
322-
} else {
323-
$user_info['date_modified_gmt'] = null; // users can have null date_modified_gmt
316+
$formatted_results = iterator_to_array(
317+
( function () use ( $users, $last_updates, $id_with_modified_date ) {
318+
foreach ( $users as $user ) {
319+
$user_info = array( 'id' => (int) $user->ID );
320+
if ( $id_with_modified_date ) {
321+
if ( isset( $last_updates[ $user->ID ] ) && ! empty( $last_updates[ $user->ID ] ) ) {
322+
$user_info['date_modified_gmt'] = $last_updates[ $user->ID ];
323+
} else {
324+
$user_info['date_modified_gmt'] = null; // users can have null date_modified_gmt
325+
}
324326
}
327+
yield $user_info;
325328
}
326-
yield $user_info;
327-
}
328-
}
329-
330-
$formatted_results = iterator_to_array( format_results( $users, $last_updates, $id_with_modified_date ) );
329+
} )()
330+
);
331331
}
332332

333333
// Get the total number of orders for the given criteria.

includes/API/Product_Tags_Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function wcpos_terms_clauses_include_exclude( array $clauses, array $taxo
145145
*
146146
* @return WP_REST_Response|WP_Error
147147
*/
148-
public function wcpos_get_all_posts( $request ): array {
148+
public function wcpos_get_all_posts( $request ) {
149149
// Start timing execution.
150150
$start_time = microtime( true );
151151
$modified_after = $request->get_param( 'modified_after' );

includes/API/Products_Controller.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,11 @@ public function wcpos_get_all_posts( $request ) {
485485
return $response;
486486
} catch ( Exception $e ) {
487487
Logger::log( 'Error fetching product data: ' . $e->getMessage() );
488-
return new WP_Error( 'woocommerce_pos_rest_cannot_fetch', 'Error fetching product data.', array( 'status' => 500 ) );
488+
return new WP_Error(
489+
'woocommerce_pos_rest_cannot_fetch',
490+
'Error fetching product data.',
491+
array( 'status' => 500 )
492+
);
489493
}
490494
}
491495

includes/API/Traits/WCPOS_REST_API.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use WC_Data;
66
use WCPOS\WooCommercePOS\Logger;
77
use WP_REST_Response;
8+
use Exception;
89

910
trait WCPOS_REST_API {
1011
/**
@@ -21,23 +22,23 @@ public function wcpos_format_all_posts_response( $results ) {
2122
*
2223
* This resulted in execution time of 10% of the original time.
2324
*/
24-
function format_results( $results ) {
25-
foreach ( $results as $result ) {
26-
$result['id'] = (int) $result['id'];
25+
return iterator_to_array(
26+
( function () use ( $results ) {
27+
foreach ( $results as $result ) {
28+
$result['id'] = (int) $result['id'];
2729

28-
if ( isset( $result['date_modified_gmt'] ) ) {
29-
if ( preg_match( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $result['date_modified_gmt'] ) ) {
30+
if ( isset( $result['date_modified_gmt'] ) ) {
31+
if ( preg_match( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $result['date_modified_gmt'] ) ) {
3032
$result['date_modified_gmt'] = preg_replace( '/(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})/', '$1T$2', $result['date_modified_gmt'] );
31-
} else {
32-
$result['date_modified_gmt'] = wc_rest_prepare_date_response( $result['date_modified_gmt'] );
33+
} else {
34+
$result['date_modified_gmt'] = wc_rest_prepare_date_response( $result['date_modified_gmt'] );
35+
}
3336
}
34-
}
35-
36-
yield $result;
37-
}
38-
}
3937

40-
return iterator_to_array( format_results( $results ) );
38+
yield $result;
39+
}
40+
} )()
41+
);
4142
}
4243

4344
/**

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
},
4444
"homepage": "https://wcpos.com",
4545
"devDependencies": {
46-
"@wordpress/babel-plugin-makepot": "5.20.0",
47-
"@wordpress/env": "8.2.0",
48-
"husky": "8.0.3",
49-
"jsdoc": "^4.0.2",
46+
"@wordpress/babel-plugin-makepot": "6.0.0",
47+
"@wordpress/env": "10.0.0",
48+
"husky": "9.0.11",
49+
"jsdoc": "^4.0.3",
5050
"npm-run-all": "4.1.5",
5151
"taffydb": "^2.7.3",
5252
"wp-hookdoc": "0.2.0"

packages/analytics/package.json

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,65 @@
55
"start": "../../node_modules/.bin/webpack --watch"
66
},
77
"dependencies": {
8-
"@tanstack/react-query": "^4.29.19",
9-
"@transifex/native": "^5.4.0",
10-
"@transifex/react": "^5.4.0",
11-
"@woocommerce/components": "^12.0.0",
12-
"@wordpress/api-fetch": "6.33.0",
13-
"@wordpress/components": "^25.2.0",
14-
"@wordpress/element": "5.13.0",
15-
"@wordpress/hooks": "^3.36.0",
16-
"@wordpress/url": "3.37.0",
17-
"classnames": "2.3.2",
8+
"@tanstack/react-query": "^5.45.0",
9+
"@transifex/native": "^7.1.1",
10+
"@transifex/react": "^7.1.1",
11+
"@woocommerce/components": "^12.3.0",
12+
"@wordpress/api-fetch": "7.0.0",
13+
"@wordpress/components": "^28.0.0",
14+
"@wordpress/element": "6.0.0",
15+
"@wordpress/hooks": "^4.0.0",
16+
"@wordpress/url": "4.0.0",
17+
"classnames": "2.5.1",
1818
"lodash": "4.17.21",
19-
"react": "18.2.0",
20-
"react-dom": "18.2.0",
21-
"react-error-boundary": "4.0.10"
19+
"react": "18.3.1",
20+
"react-dom": "18.3.1",
21+
"react-error-boundary": "4.0.13"
2222
},
2323
"devDependencies": {
24-
"@babel/core": "7.22.6",
25-
"@babel/plugin-transform-runtime": "7.22.6",
26-
"@babel/preset-env": "7.22.6",
27-
"@babel/preset-react": "7.22.5",
28-
"@babel/preset-typescript": "7.22.5",
29-
"@babel/runtime": "7.22.6",
30-
"@svgr/webpack": "8.0.1",
31-
"@tanstack/react-query-devtools": "^4.29.19",
32-
"@transifex/cli": "^5.4.0",
33-
"@types/jest": "29.5.2",
34-
"@types/lodash": "4.14.195",
35-
"@types/react": "18.2.14",
36-
"@types/react-beautiful-dnd": "13.1.4",
37-
"@types/react-dom": "18.2.6",
38-
"@types/wordpress__components": "^23.0.1",
39-
"@typescript-eslint/eslint-plugin": "5.61.0",
40-
"@typescript-eslint/parser": "5.61.0",
24+
"@babel/core": "7.24.7",
25+
"@babel/plugin-transform-runtime": "7.24.7",
26+
"@babel/preset-env": "7.24.7",
27+
"@babel/preset-react": "7.24.7",
28+
"@babel/preset-typescript": "7.24.7",
29+
"@babel/runtime": "7.24.7",
30+
"@svgr/webpack": "8.1.0",
31+
"@tanstack/react-query-devtools": "^5.45.0",
32+
"@transifex/cli": "^7.1.1",
33+
"@types/jest": "29.5.12",
34+
"@types/lodash": "4.17.5",
35+
"@types/react": "18.3.3",
36+
"@types/react-beautiful-dnd": "13.1.8",
37+
"@types/react-dom": "18.3.0",
38+
"@types/wordpress__components": "^23.8.0",
39+
"@typescript-eslint/eslint-plugin": "7.13.0",
40+
"@typescript-eslint/parser": "7.13.0",
4141
"@wcpos/eslint-config": "*",
42-
"@wordpress/env": "8.2.0",
43-
"autoprefixer": "10.4.14",
44-
"babel-loader": "9.1.2",
45-
"css-loader": "6.8.1",
46-
"css-minimizer-webpack-plugin": "^5.0.1",
42+
"@wordpress/env": "10.0.0",
43+
"autoprefixer": "10.4.19",
44+
"babel-loader": "9.1.3",
45+
"css-loader": "7.1.2",
46+
"css-minimizer-webpack-plugin": "^7.0.0",
4747
"file-loader": "6.2.0",
48-
"fork-ts-checker-webpack-plugin": "8.0.0",
49-
"html-webpack-plugin": "5.5.3",
50-
"husky": "8.0.3",
51-
"jest": "29.6.0",
52-
"jsdoc": "4.0.2",
53-
"mini-css-extract-plugin": "2.7.6",
48+
"fork-ts-checker-webpack-plugin": "9.0.2",
49+
"html-webpack-plugin": "5.6.0",
50+
"husky": "9.0.11",
51+
"jest": "29.7.0",
52+
"jsdoc": "4.0.3",
53+
"mini-css-extract-plugin": "2.9.0",
5454
"node-sass": "9.0.0",
5555
"npm-run-all": "4.1.5",
56-
"postcss": "8.4.24",
57-
"postcss-cli": "10.1.0",
58-
"postcss-loader": "7.3.3",
59-
"prettier": "2.8.8",
60-
"sass-loader": "13.3.2",
61-
"style-loader": "3.3.3",
62-
"terser-webpack-plugin": "5.3.9",
63-
"ts-loader": "^9.4.4",
64-
"typescript": "5.1.6",
65-
"webpack": "5.88.1",
66-
"webpack-bundle-analyzer": "^4.9.0",
56+
"postcss": "8.4.38",
57+
"postcss-cli": "11.0.0",
58+
"postcss-loader": "8.1.1",
59+
"prettier": "3.3.2",
60+
"sass-loader": "14.2.1",
61+
"style-loader": "4.0.0",
62+
"terser-webpack-plugin": "5.3.10",
63+
"ts-loader": "^9.5.1",
64+
"typescript": "5.4.5",
65+
"webpack": "5.92.0",
66+
"webpack-bundle-analyzer": "^4.10.2",
6767
"webpack-cli": "5.1.4",
6868
"webpack-livereload-plugin": "3.0.2",
6969
"wp-hookdoc": "0.2.0"

0 commit comments

Comments
 (0)