Skip to content

Commit

Permalink
update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Jun 15, 2024
1 parent 561cf10 commit 40df182
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 156 deletions.
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ hookdoc-conf.json
package.json
yarn.lock
php-scoper
generate_autoload.php
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ yarn.lock
hookdocs
*.cache
phpunit.xml
tests/logs/junit.xml
5 changes: 3 additions & 2 deletions .phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="coverage/clover.xml" />
</logging>
<log type="coverage-clover" target="coverage/clover.xml" />
<log type="junit" target="tests/logs/junit.xml" />
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<img src="https://github.com/wcpos/woocommerce-pos/actions/workflows/wporg-deploy.yml/badge.svg" alt="Deploy to WordPress.org" />
</a>
<a href="https://wcpos.com/discord">
<img src="https://img.shields.io/discord/711884517081612298?color=%237289DA&label=WCPOS&logo=discord&logoColor=white" alt="Discord chat" />
<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" />
</a>
</p>
<p>
Expand Down
26 changes: 13 additions & 13 deletions includes/API/Customers_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,21 +313,21 @@ public function wcpos_get_all_posts( $request ) {
}
}
} else {
function format_results( $users, $last_updates, $id_with_modified_date ) {
foreach ( $users as $user ) {
$user_info = array( 'id' => (int) $user->ID );
if ( $id_with_modified_date ) {
if ( isset( $last_updates[ $user->ID ] ) && ! empty( $last_updates[ $user->ID ] ) ) {
$user_info['date_modified_gmt'] = $last_updates[ $user->ID ];
} else {
$user_info['date_modified_gmt'] = null; // users can have null date_modified_gmt
$formatted_results = iterator_to_array(
( function () use ( $users, $last_updates, $id_with_modified_date ) {
foreach ( $users as $user ) {
$user_info = array( 'id' => (int) $user->ID );
if ( $id_with_modified_date ) {
if ( isset( $last_updates[ $user->ID ] ) && ! empty( $last_updates[ $user->ID ] ) ) {
$user_info['date_modified_gmt'] = $last_updates[ $user->ID ];
} else {
$user_info['date_modified_gmt'] = null; // users can have null date_modified_gmt
}
}
yield $user_info;
}
yield $user_info;
}
}

$formatted_results = iterator_to_array( format_results( $users, $last_updates, $id_with_modified_date ) );
} )()
);
}

// Get the total number of orders for the given criteria.
Expand Down
2 changes: 1 addition & 1 deletion includes/API/Product_Tags_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function wcpos_terms_clauses_include_exclude( array $clauses, array $taxo
*
* @return WP_REST_Response|WP_Error
*/
public function wcpos_get_all_posts( $request ): array {
public function wcpos_get_all_posts( $request ) {
// Start timing execution.
$start_time = microtime( true );
$modified_after = $request->get_param( 'modified_after' );
Expand Down
6 changes: 5 additions & 1 deletion includes/API/Products_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,11 @@ public function wcpos_get_all_posts( $request ) {
return $response;
} catch ( Exception $e ) {
Logger::log( 'Error fetching product data: ' . $e->getMessage() );
return new WP_Error( 'woocommerce_pos_rest_cannot_fetch', 'Error fetching product data.', array( 'status' => 500 ) );
return new WP_Error(
'woocommerce_pos_rest_cannot_fetch',
'Error fetching product data.',
array( 'status' => 500 )
);
}
}

Expand Down
27 changes: 14 additions & 13 deletions includes/API/Traits/WCPOS_REST_API.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use WC_Data;
use WCPOS\WooCommercePOS\Logger;
use WP_REST_Response;
use Exception;

trait WCPOS_REST_API {
/**
Expand All @@ -21,23 +22,23 @@ public function wcpos_format_all_posts_response( $results ) {
*
* This resulted in execution time of 10% of the original time.
*/
function format_results( $results ) {
foreach ( $results as $result ) {
$result['id'] = (int) $result['id'];
return iterator_to_array(
( function () use ( $results ) {
foreach ( $results as $result ) {
$result['id'] = (int) $result['id'];

if ( isset( $result['date_modified_gmt'] ) ) {
if ( preg_match( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $result['date_modified_gmt'] ) ) {
if ( isset( $result['date_modified_gmt'] ) ) {
if ( preg_match( '/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', $result['date_modified_gmt'] ) ) {
$result['date_modified_gmt'] = preg_replace( '/(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2})/', '$1T$2', $result['date_modified_gmt'] );
} else {
$result['date_modified_gmt'] = wc_rest_prepare_date_response( $result['date_modified_gmt'] );
} else {
$result['date_modified_gmt'] = wc_rest_prepare_date_response( $result['date_modified_gmt'] );
}
}
}

yield $result;
}
}

return iterator_to_array( format_results( $results ) );
yield $result;
}
} )()
);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
},
"homepage": "https://wcpos.com",
"devDependencies": {
"@wordpress/babel-plugin-makepot": "5.20.0",
"@wordpress/env": "8.2.0",
"husky": "8.0.3",
"jsdoc": "^4.0.2",
"@wordpress/babel-plugin-makepot": "6.0.0",
"@wordpress/env": "10.0.0",
"husky": "9.0.11",
"jsdoc": "^4.0.3",
"npm-run-all": "4.1.5",
"taffydb": "^2.7.3",
"wp-hookdoc": "0.2.0"
Expand Down
104 changes: 52 additions & 52 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,65 @@
"start": "../../node_modules/.bin/webpack --watch"
},
"dependencies": {
"@tanstack/react-query": "^4.29.19",
"@transifex/native": "^5.4.0",
"@transifex/react": "^5.4.0",
"@woocommerce/components": "^12.0.0",
"@wordpress/api-fetch": "6.33.0",
"@wordpress/components": "^25.2.0",
"@wordpress/element": "5.13.0",
"@wordpress/hooks": "^3.36.0",
"@wordpress/url": "3.37.0",
"classnames": "2.3.2",
"@tanstack/react-query": "^5.45.0",
"@transifex/native": "^7.1.1",
"@transifex/react": "^7.1.1",
"@woocommerce/components": "^12.3.0",
"@wordpress/api-fetch": "7.0.0",
"@wordpress/components": "^28.0.0",
"@wordpress/element": "6.0.0",
"@wordpress/hooks": "^4.0.0",
"@wordpress/url": "4.0.0",
"classnames": "2.5.1",
"lodash": "4.17.21",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-error-boundary": "4.0.10"
"react": "18.3.1",
"react-dom": "18.3.1",
"react-error-boundary": "4.0.13"
},
"devDependencies": {
"@babel/core": "7.22.6",
"@babel/plugin-transform-runtime": "7.22.6",
"@babel/preset-env": "7.22.6",
"@babel/preset-react": "7.22.5",
"@babel/preset-typescript": "7.22.5",
"@babel/runtime": "7.22.6",
"@svgr/webpack": "8.0.1",
"@tanstack/react-query-devtools": "^4.29.19",
"@transifex/cli": "^5.4.0",
"@types/jest": "29.5.2",
"@types/lodash": "4.14.195",
"@types/react": "18.2.14",
"@types/react-beautiful-dnd": "13.1.4",
"@types/react-dom": "18.2.6",
"@types/wordpress__components": "^23.0.1",
"@typescript-eslint/eslint-plugin": "5.61.0",
"@typescript-eslint/parser": "5.61.0",
"@babel/core": "7.24.7",
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.24.7",
"@babel/preset-react": "7.24.7",
"@babel/preset-typescript": "7.24.7",
"@babel/runtime": "7.24.7",
"@svgr/webpack": "8.1.0",
"@tanstack/react-query-devtools": "^5.45.0",
"@transifex/cli": "^7.1.1",
"@types/jest": "29.5.12",
"@types/lodash": "4.17.5",
"@types/react": "18.3.3",
"@types/react-beautiful-dnd": "13.1.8",
"@types/react-dom": "18.3.0",
"@types/wordpress__components": "^23.8.0",
"@typescript-eslint/eslint-plugin": "7.13.0",
"@typescript-eslint/parser": "7.13.0",
"@wcpos/eslint-config": "*",
"@wordpress/env": "8.2.0",
"autoprefixer": "10.4.14",
"babel-loader": "9.1.2",
"css-loader": "6.8.1",
"css-minimizer-webpack-plugin": "^5.0.1",
"@wordpress/env": "10.0.0",
"autoprefixer": "10.4.19",
"babel-loader": "9.1.3",
"css-loader": "7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "8.0.0",
"html-webpack-plugin": "5.5.3",
"husky": "8.0.3",
"jest": "29.6.0",
"jsdoc": "4.0.2",
"mini-css-extract-plugin": "2.7.6",
"fork-ts-checker-webpack-plugin": "9.0.2",
"html-webpack-plugin": "5.6.0",
"husky": "9.0.11",
"jest": "29.7.0",
"jsdoc": "4.0.3",
"mini-css-extract-plugin": "2.9.0",
"node-sass": "9.0.0",
"npm-run-all": "4.1.5",
"postcss": "8.4.24",
"postcss-cli": "10.1.0",
"postcss-loader": "7.3.3",
"prettier": "2.8.8",
"sass-loader": "13.3.2",
"style-loader": "3.3.3",
"terser-webpack-plugin": "5.3.9",
"ts-loader": "^9.4.4",
"typescript": "5.1.6",
"webpack": "5.88.1",
"webpack-bundle-analyzer": "^4.9.0",
"postcss": "8.4.38",
"postcss-cli": "11.0.0",
"postcss-loader": "8.1.1",
"prettier": "3.3.2",
"sass-loader": "14.2.1",
"style-loader": "4.0.0",
"terser-webpack-plugin": "5.3.10",
"ts-loader": "^9.5.1",
"typescript": "5.4.5",
"webpack": "5.92.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "5.1.4",
"webpack-livereload-plugin": "3.0.2",
"wp-hookdoc": "0.2.0"
Expand Down
30 changes: 15 additions & 15 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
"test": "echo 'Nothing to test'"
},
"dependencies": {
"@rushstack/eslint-patch": "^1.3.2",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "5.61.0",
"@rushstack/eslint-patch": "^1.10.3",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "7.13.0",
"@wcpos/tsconfig": "*",
"eslint": "8.44.0",
"eslint": "9.5.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "8.8.0",
"eslint-config-universe": "^11.3.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jest": "27.2.2",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-native": "4.0.0",
"prettier": "2.8.8",
"typescript": "^5.1.6"
"eslint-config-prettier": "9.1.0",
"eslint-config-universe": "^13.0.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jest": "28.6.0",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.2",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-native": "4.1.0",
"prettier": "3.3.2",
"typescript": "^5.4.5"
}
}
Loading

0 comments on commit 40df182

Please sign in to comment.