Skip to content

Commit b04562f

Browse files
committed
fix: dart generation
1 parent 7a7b1cc commit b04562f

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

generators/src/main/java/com/algolia/codegen/cts/tests/SnippetsGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ private Map<String, Snippet[]> loadSnippets(Map<String, CodegenOperation> operat
9393
public void run(Map<String, CodegenModel> models, Map<String, CodegenOperation> operations, Map<String, Object> bundle) throws Exception {
9494
Map<String, Snippet[]> snippets = loadSnippets(operations);
9595

96+
bundle.put("isSnippet", true);
97+
9698
if (this.client.equals("search")) {
9799
bundle.put("isSearchClient", true);
98100
}

templates/dart/pubspec.tests.mustache

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: algolia_snippets
1+
name: algolia_{{#isSnippet}}snippets{{/isSnippet}}{{^isSnippet}}test{{/isSnippet}}
22
version: 1.0.0
33

44
environment:
@@ -7,7 +7,6 @@ environment:
77
dependencies:
88
algolia_client_abtesting_v3: ^1.0.0
99
algolia_client_composition: ^1.0.0
10-
algolia_client_core: any
1110
algolia_client_insights: ^1.0.0
1211
algolia_client_recommend: ^1.0.0
1312
algolia_client_search: ^1.0.0
@@ -18,5 +17,7 @@ dependencies:
1817
test: ^1.25.8
1918
test_api: ^0.7.3
2019

20+
algolia_client_core: any
21+
2122
dev_dependencies:
2223
lints: ^6.0.0

tests/output/dart/pubspec.yaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
name: algolia_snippets
1+
name: algolia_test
22
version: 1.0.0
33

44
environment:
55
sdk: ^3.0.0
66

77
dependencies:
8-
algoliasearch: ^1.0.0
9-
algolia_client_search: ^1.0.0
8+
algolia_client_abtesting_v3: ^1.0.0
9+
algolia_client_composition: ^1.0.0
1010
algolia_client_insights: ^1.0.0
1111
algolia_client_recommend: ^1.0.0
12-
algolia_client_composition: ^1.0.0
13-
algolia_client_abtesting_v3: ^1.0.0
12+
algolia_client_search: ^1.0.0
13+
algoliasearch: ^1.0.0
14+
collection: ^1.17.2
1415
dotenv: ^4.1.0
1516
http: ^1.2.2
17+
test: ^1.25.8
18+
test_api: ^0.7.3
1619

1720
algolia_client_core: any
18-
algolia_test: any
19-
collection: any
20-
test: any
21-
test_api: any
21+
2222
dev_dependencies:
23-
lints: ^6.0.0 algolia_test: any
24-
test: any
25-
test_api: any
23+
lints: ^6.0.0

0 commit comments

Comments
 (0)