Skip to content

Commit 412256d

Browse files
authored
Merge branch 'main' into chore/upgrade-swift-version
2 parents 874a79f + dbaac0d commit 412256d

File tree

3,067 files changed

+85331
-48170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,067 files changed

+85331
-48170
lines changed

.eslintrc.cjs

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module.exports = {
88
'**/dist',
99
'**/target',
1010
'**/.yarn',
11-
'website/specs',
1211
'**/project.packagespec.json',
1312
],
1413

@@ -127,14 +126,42 @@ module.exports = {
127126
],
128127
},
129128
],
130-
'@typescript-eslint/ban-types': [
129+
'@typescript-eslint/no-restricted-types': [
131130
'error',
132131
{
133132
types: {
133+
String: {
134+
message: 'Use `string` instead.',
135+
fixWith: 'string',
136+
},
137+
Number: {
138+
message: 'Use `number` instead.',
139+
fixWith: 'number',
140+
},
141+
Boolean: {
142+
message: 'Use `boolean` instead.',
143+
fixWith: 'boolean',
144+
},
145+
Symbol: {
146+
message: 'Use `symbol` instead.',
147+
fixWith: 'symbol',
148+
},
149+
Object: {
150+
message:
151+
'The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848',
152+
fixWith: 'Record<string, unknown>',
153+
},
154+
'{}': {
155+
message:
156+
'The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.',
157+
fixWith: 'Record<string, unknown>',
158+
},
134159
object: {
135-
message: 'Use Record instead',
136-
fixWith: 'Record<string, any>',
160+
message:
161+
'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
162+
fixWith: 'Record<string, unknown>',
137163
},
164+
Function: 'Use a specific function type instead, like `() => void`.',
138165
},
139166
},
140167
],
@@ -146,15 +173,9 @@ module.exports = {
146173
],
147174
},
148175
},
149-
// JS client rules
150176
{
151177
files: ['clients/algoliasearch-client-javascript/packages/**/*.ts'],
152178

153-
parserOptions: {
154-
tsconfigRootDir: __dirname,
155-
project: './clients/algoliasearch-client-javascript/tsconfig.json',
156-
},
157-
158179
rules: {
159180
// For a wider browser support (IE>=11), we forbid those two
160181
'no-restricted-syntax': [
@@ -171,12 +192,14 @@ module.exports = {
171192
},
172193
],
173194
'@typescript-eslint/prefer-optional-chain': 0,
174-
},
195+
}
175196
},
176197
{
177198
files: ['*.json'],
178-
179-
plugins: ['json-format'],
199+
parserOptions: {
200+
extraFileExtensions: ['.json'],
201+
},
202+
extends: ["plugin:json/recommended-legacy"]
180203
},
181204
{
182205
files: ['templates/**/*.mustache'],

.github/ISSUE_TEMPLATE/Bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ body:
4343
id: client
4444
attributes:
4545
label: Client
46-
description: What API are you targetting?
46+
description: Which API are you targetting?
4747
options:
4848
- All
4949
- AB testing

.github/actions/setup/action.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ inputs:
99
language:
1010
description: the language for which to install deps
1111
required: false
12+
version:
13+
description: the version of the language to setup
14+
required: false
1215

1316
runs:
1417
using: composite
1518
steps:
1619
# Java for code generation
1720
- name: Install Java
1821
if: inputs.type != 'minimal'
19-
uses: actions/[email protected].1
22+
uses: actions/[email protected].2
2023
with:
2124
distribution: zulu
2225
java-version-file: config/.java-version
@@ -48,19 +51,6 @@ runs:
4851
shell: bash
4952
run: yarn workspace scripts build:cli
5053

51-
- name: Get all languages versions
52-
id: versions
53-
shell: bash
54-
run: |
55-
# remove patch from php version
56-
echo "CSHARP_VERSION=$(cat config/.csharp-version)" >> $GITHUB_OUTPUT
57-
echo "DART_VERSION=$(cat config/.dart-version)" >> $GITHUB_OUTPUT
58-
echo "GO_VERSION=$(cat config/.go-version)" >> $GITHUB_OUTPUT
59-
echo "PHP_VERSION=$(cat config/.php-version | cut -d '.' -f 1,2)" >> $GITHUB_OUTPUT
60-
echo "PYTHON_VERSION=$(cat config/.python-version)" >> $GITHUB_OUTPUT
61-
echo "RUBY_VERSION=$(cat config/.ruby-version)" >> $GITHUB_OUTPUT
62-
echo "SWIFT_VERSION=$(cat config/.swift-version)" >> $GITHUB_OUTPUT
63-
6454
# JavaScript client deps
6555
- name: Get yarn js-client cache directory path
6656
if: ${{ inputs.language == 'javascript' }}
@@ -92,7 +82,7 @@ runs:
9282
if: ${{ inputs.language == 'php' }}
9383
uses: shivammathur/setup-php@v2
9484
with:
95-
php-version: ${{ steps.versions.outputs.PHP_VERSION }}
85+
php-version: ${{ inputs.version }}
9686
tools: composer
9787

9888
- name: Run composer install
@@ -108,13 +98,13 @@ runs:
10898
uses: actions/setup-go@v5
10999
with:
110100
cache-dependency-path: clients/algoliasearch-client-go/go.sum
111-
go-version: ${{ steps.versions.outputs.GO_VERSION }}
101+
go-version: ${{ inputs.version }}
112102

113103
- name: Install golangci-lint
114104
if: ${{ inputs.language == 'go' }}
115105
shell: bash
116106
run: |
117-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.0
107+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.3
118108
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
119109
go install golang.org/x/tools/cmd/goimports@latest
120110
@@ -123,7 +113,7 @@ runs:
123113
uses: actions/cache@v4
124114
with:
125115
path: ~/.cache/golangci-lint
126-
key: golangci-lint-${{ steps.versions.outputs.GO_VERSION }}-${{ hashFiles('clients/algoliasearch-client-go/go.sum') }}
116+
key: golangci-lint-${{ inputs.version }}-${{ hashFiles('clients/algoliasearch-client-go/go.sum') }}
127117

128118
# Kotlin
129119
- name: Cache spotless
@@ -138,7 +128,7 @@ runs:
138128
if: ${{ inputs.language == 'dart' }}
139129
uses: dart-lang/setup-dart@v1
140130
with:
141-
sdk: ${{ steps.versions.outputs.DART_VERSION }}
131+
sdk: ${{ inputs.version }}
142132

143133
- name: Setup dart tools
144134
if: ${{ inputs.language == 'dart' }}
@@ -154,7 +144,7 @@ runs:
154144
- uses: actions/setup-python@v5
155145
if: ${{ inputs.language == 'python' }}
156146
with:
157-
python-version: ${{ steps.versions.outputs.PYTHON_VERSION }}
147+
python-version: ${{ inputs.version }}
158148
cache: 'poetry'
159149

160150
- run: poetry install
@@ -167,7 +157,7 @@ runs:
167157
if: ${{ inputs.language == 'ruby' }}
168158
uses: ruby/setup-ruby@v1
169159
with:
170-
ruby-version: ${{ steps.versions.outputs.RUBY_VERSION }}
160+
ruby-version: ${{ inputs.version }}
171161
bundler-cache: true
172162

173163
- name: Install Ruby formatter
@@ -184,7 +174,7 @@ runs:
184174
if: ${{ inputs.language == 'csharp' }}
185175
uses: actions/setup-dotnet@v4
186176
with:
187-
dotnet-version: ${{ steps.versions.outputs.CSHARP_VERSION }}
177+
dotnet-version: ${{ inputs.version }}
188178

189179
# Swift deps
190180
- name: Install swift
@@ -195,7 +185,7 @@ runs:
195185
# uses: swift-actions/setup-swift@v2
196186
uses: redsun82/setup-swift@b2b6f77ab14f6a9b136b520dc53ec8eca27d2b99
197187
with:
198-
swift-version: ${{ steps.versions.outputs.SWIFT_VERSION }}
188+
swift-version: ${{ inputs.version }}
199189

200190
- name: Cache the build folder
201191
id: cache-swift-build
@@ -205,13 +195,13 @@ runs:
205195
path: |
206196
clients/algoliasearch-client-swift/.build
207197
tests/output/swift/.build
208-
key: swift-build-${{ steps.versions.outputs.SWIFT_VERSION }}-${{ runner.os }}
198+
key: swift-build-${{ inputs.version }}-${{ runner.os }}
209199

210200
- name: Set swiftformat version
211201
if: ${{ inputs.language == 'swift' }}
212202
id: swiftformat-version
213203
shell: bash
214-
run: echo "SWIFTFORMAT_VERSION=0.54.3" >> $GITHUB_OUTPUT
204+
run: echo "SWIFTFORMAT_VERSION=0.54.4" >> $GITHUB_OUTPUT
215205

216206
- name: Checkout swiftformat
217207
if: ${{ inputs.language == 'swift' }}

0 commit comments

Comments
 (0)