From d4785e87980b58f0aaf9bba6bc3a2abb5553a708 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 05:36:47 +0000 Subject: [PATCH 1/4] chore(deps): update dependency dart to v3.5.3 --- config/.dart-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/.dart-version b/config/.dart-version index 351227fca34..444877d48fb 100644 --- a/config/.dart-version +++ b/config/.dart-version @@ -1 +1 @@ -3.2.4 +3.5.3 From 660b59990c85f72874b48ec70312d3b83d2f0bbd Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 16 Sep 2024 11:34:23 +0200 Subject: [PATCH 2/4] upgrade dart test --- .../packages/client_core/pubspec.yaml | 2 +- config/.dart-version | 2 +- scripts/buildClients.ts | 3 +++ templates/dart/pubspec.mustache | 2 +- tests/output/dart/pubspec.yaml | 7 ++++--- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml index c11d4d2260c..be476afbf9d 100644 --- a/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml +++ b/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml @@ -13,4 +13,4 @@ dependencies: dio: ^5.2.1 dev_dependencies: lints: ^4.0.0 - test: ^1.24.3 + test: ^1.25.8 diff --git a/config/.dart-version b/config/.dart-version index 444877d48fb..87ce492908a 100644 --- a/config/.dart-version +++ b/config/.dart-version @@ -1 +1 @@ -3.5.3 +3.5.2 diff --git a/scripts/buildClients.ts b/scripts/buildClients.ts index 0653d627242..f35d25a6973 100644 --- a/scripts/buildClients.ts +++ b/scripts/buildClients.ts @@ -15,6 +15,9 @@ async function buildLanguage(language: Language, gens: Generator[], buildType: B case 'csharp': await run('dotnet build --configuration Release', { cwd, language }); break; + case 'dart': + await run('dart analyze', { cwd, language }); + break; case 'go': await run('go build ./...', { cwd, language }); break; diff --git a/templates/dart/pubspec.mustache b/templates/dart/pubspec.mustache index 9ed625e3782..538e59a37cd 100644 --- a/templates/dart/pubspec.mustache +++ b/templates/dart/pubspec.mustache @@ -29,4 +29,4 @@ dev_dependencies: json_serializable: ^6.7.0 lints: ^4.0.0 logging: ^1.2.0 - test: ^1.24.3 \ No newline at end of file + test: ^1.25.8 diff --git a/tests/output/dart/pubspec.yaml b/tests/output/dart/pubspec.yaml index f08cae30c03..53951638464 100644 --- a/tests/output/dart/pubspec.yaml +++ b/tests/output/dart/pubspec.yaml @@ -9,9 +9,10 @@ dependencies: algolia_client_search: ^1.0.0 algolia_client_insights: ^1.0.0 algolia_client_recommend: ^1.0.0 - test: ^1.24.3 + test: ^1.25.8 collection: ^1.17.2 - test_api: ^0.6.0 + test_api: ^0.7.3 + algolia_client_core: any dev_dependencies: - lints: ^3.0.0 + lints: ^4.0.0 From b8c33b9975933940e935710ad59ed4ce4ee27f07 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 16 Sep 2024 14:10:21 +0200 Subject: [PATCH 3/4] fix dart playground --- playground/dart/lib/recommend.dart | 22 +++++++--------------- scripts/buildClients.ts | 5 ++++- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/playground/dart/lib/recommend.dart b/playground/dart/lib/recommend.dart index 96d12f5fe28..cf909809be8 100644 --- a/playground/dart/lib/recommend.dart +++ b/playground/dart/lib/recommend.dart @@ -9,23 +9,19 @@ void main() async { appId: dotenv['ALGOLIA_APPLICATION_ID']!, apiKey: dotenv['ALGOLIA_SEARCH_KEY']!, ); - final indexName = dotenv['SEARCH_INDEX']!; // Creating recommendation requests for different products. var requests = [ - RecommendationRequest( - model: RecommendationModels.relatedProducts, + RelatedProducts( + model: RelatedModel.relatedProducts, objectID: '6445156', - indexName: indexName, - threshold: 70, - maxRecommendations: 3, + fallbackParameters: FallbackParams( + query: 'iphone', + ), ), - RecommendationRequest( - model: RecommendationModels.relatedProducts, + RelatedProducts( + model: RelatedModel.relatedProducts, objectID: '6443034', - indexName: indexName, - threshold: 70, - maxRecommendations: 3, ) ]; @@ -44,10 +40,6 @@ void main() async { /// Prints the search hits. void printRecommendations(GetRecommendationsResponse response) { final results = response.results; - if (results == null) { - print("No recommendations found"); - return; - } // Loop over each result and map over the search hits, // converting each hit to a product. diff --git a/scripts/buildClients.ts b/scripts/buildClients.ts index f35d25a6973..4e5df67ac13 100644 --- a/scripts/buildClients.ts +++ b/scripts/buildClients.ts @@ -16,7 +16,10 @@ async function buildLanguage(language: Language, gens: Generator[], buildType: B await run('dotnet build --configuration Release', { cwd, language }); break; case 'dart': - await run('dart analyze', { cwd, language }); + if (buildType !== 'snippets') { + // fix the snippets at some point + await run('dart analyze', { cwd, language }); + } break; case 'go': await run('go build ./...', { cwd, language }); From 2d3e0495ac08c85a57c172f6339bb21751293617 Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Mon, 16 Sep 2024 14:22:23 +0200 Subject: [PATCH 4/4] pub get --- scripts/buildClients.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildClients.ts b/scripts/buildClients.ts index 4e5df67ac13..a1d6c191d55 100644 --- a/scripts/buildClients.ts +++ b/scripts/buildClients.ts @@ -18,7 +18,7 @@ async function buildLanguage(language: Language, gens: Generator[], buildType: B case 'dart': if (buildType !== 'snippets') { // fix the snippets at some point - await run('dart analyze', { cwd, language }); + await run('dart pub get && dart analyze', { cwd, language }); } break; case 'go':