Skip to content

Commit 608df7f

Browse files
authored
Merge 1f682c1 into 7d08d1e
2 parents 7d08d1e + 1f682c1 commit 608df7f

File tree

109 files changed

+2718
-2617
lines changed

Some content is hidden

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

109 files changed

+2718
-2617
lines changed

.eslintrc.cjs

Lines changed: 32 additions & 11 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,7 +192,7 @@ module.exports = {
171192
},
172193
],
173194
'@typescript-eslint/prefer-optional-chain': 0,
174-
},
195+
}
175196
},
176197
{
177198
files: ['*.json'],

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ runs:
114114
if: ${{ inputs.language == 'go' }}
115115
shell: bash
116116
run: |
117-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.0
117+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.3
118118
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
119119
go install golang.org/x/tools/cmd/goimports@latest
120120

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.16.0
1+
22.7.0

.yarn/releases/yarn-4.4.0.cjs renamed to .yarn/releases/yarn-4.4.1.cjs

Lines changed: 174 additions & 174 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ enableGlobalCache: false
44

55
nodeLinker: node-modules
66

7-
yarnPath: .yarn/releases/yarn-4.4.0.cjs
7+
yarnPath: .yarn/releases/yarn-4.4.1.cjs
Binary file not shown.

clients/algoliasearch-client-java/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.16.0
1+
22.7.0

clients/algoliasearch-client-javascript/.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

clients/algoliasearch-client-javascript/.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

clients/algoliasearch-client-javascript/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616
},
1717
"devDependencies": {
1818
"@babel/core": "7.25.2",
19-
"@babel/plugin-transform-class-properties": "7.24.7",
20-
"@babel/plugin-transform-runtime": "7.24.7",
21-
"@babel/preset-env": "7.25.3",
22-
"@babel/runtime": "7.25.0",
19+
"@babel/plugin-transform-class-properties": "7.25.4",
20+
"@babel/plugin-transform-runtime": "7.25.4",
21+
"@babel/preset-env": "7.25.4",
22+
"@babel/runtime": "7.25.4",
2323
"@rollup/plugin-babel": "6.0.4",
2424
"@rollup/plugin-node-resolve": "15.2.3",
2525
"@rollup/plugin-terser": "0.4.4",
2626
"@types/jest": "29.5.12",
27-
"@types/node": "20.14.14",
27+
"@types/node": "22.5.0",
2828
"@types/rollup-plugin-node-globals": "1.4.4",
2929
"@types/semver": "7.5.8",
3030
"bundlesize": "0.18.2",
31-
"execa": "9.3.0",
31+
"execa": "9.3.1",
3232
"lerna": "8.1.8",
33-
"nx": "19.5.7",
34-
"rollup": "4.20.0",
33+
"nx": "19.6.2",
34+
"rollup": "4.21.0",
3535
"rollup-plugin-node-globals": "1.4.0",
3636
"rollup-plugin-typescript2": "0.36.0",
3737
"semver": "7.6.3",

clients/algoliasearch-client-javascript/packages/algoliasearch/__tests__/algoliasearch.browser.test.ts

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('api', () => {
2828
})) as unknown as EchoResponse;
2929

3030
expect(req.algoliaAgent).toMatchInlineSnapshot(
31-
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Browser"`
31+
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Browser"`,
3232
);
3333
});
3434

@@ -47,9 +47,7 @@ describe('api', () => {
4747
describe('_ua', () => {
4848
it('provides a backward compatible `_ua` variable at the root of the client', () => {
4949
expect(client._ua).toEqual(
50-
expect.stringContaining(
51-
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
52-
)
50+
expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
5351
);
5452
});
5553

@@ -58,9 +56,7 @@ describe('api', () => {
5856

5957
client.addAlgoliaAgent('Jest', '0.0.1');
6058

61-
expect(client._ua).toEqual(
62-
expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g)
63-
);
59+
expect(client._ua).toEqual(expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g));
6460
});
6561
});
6662

@@ -69,9 +65,7 @@ describe('api', () => {
6965
expect(client.transporter).toEqual({
7066
algoliaAgent: {
7167
add: expect.any(Function),
72-
value: expect.stringContaining(
73-
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
74-
),
68+
value: expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
7569
},
7670
baseHeaders: {
7771
'content-type': 'text/plain',
@@ -171,19 +165,19 @@ describe('api', () => {
171165
expect.objectContaining({
172166
'x-algolia-application-id': 'APP_ID',
173167
'x-algolia-api-key': 'API_KEY',
174-
})
168+
}),
175169
);
176170
expect(res2.searchParams).toEqual(
177171
expect.objectContaining({
178172
'x-algolia-application-id': 'APP_ID',
179173
'x-algolia-api-key': 'API_KEY',
180-
})
174+
}),
181175
);
182176
expect(res3.searchParams).toEqual(
183177
expect.objectContaining({
184178
'x-algolia-application-id': 'APP_ID',
185179
'x-algolia-api-key': 'API_KEY',
186-
})
180+
}),
187181
);
188182
});
189183

@@ -216,19 +210,19 @@ describe('api', () => {
216210
expect.objectContaining({
217211
'x-algolia-application-id': 'appId1',
218212
'x-algolia-api-key': 'apiKey1',
219-
})
213+
}),
220214
);
221215
expect(res2.searchParams).toEqual(
222216
expect.objectContaining({
223217
'x-algolia-application-id': 'appId2',
224218
'x-algolia-api-key': 'apiKey2',
225-
})
219+
}),
226220
);
227221
expect(res3.searchParams).toEqual(
228222
expect.objectContaining({
229223
'x-algolia-application-id': 'appId3',
230224
'x-algolia-api-key': 'apiKey3',
231-
})
225+
}),
232226
);
233227
});
234228
});
@@ -274,9 +268,7 @@ describe('search with legacy signature', () => {
274268
expect(req.path).toEqual('/1/indexes/*/queries');
275269
expect(req.method).toEqual('POST');
276270
expect(req.data).toEqual({
277-
requests: [
278-
{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' },
279-
],
271+
requests: [{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' }],
280272
});
281273
expect(req.searchParams).toStrictEqual({
282274
'x-algolia-api-key': 'API_KEY',

clients/algoliasearch-client-javascript/packages/algoliasearch/__tests__/algoliasearch.node.test.ts

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('api', () => {
2828
})) as unknown as EchoResponse;
2929

3030
expect(req.algoliaAgent).toMatchInlineSnapshot(
31-
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Node.js%20(${process.versions.node})"`
31+
`"Algolia%20for%20JavaScript%20(${apiClientVersion})%3B%20Search%20(${apiClientVersion})%3B%20Node.js%20(${process.versions.node})"`,
3232
);
3333
});
3434

@@ -47,22 +47,16 @@ describe('api', () => {
4747
describe('_ua', () => {
4848
it('provides a backward compatible `_ua` variable at the root of the client', () => {
4949
expect(client._ua).toEqual(
50-
expect.stringContaining(
51-
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
52-
)
50+
expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
5351
);
5452
});
5553

5654
it('keeps `_ua` updated with the transporter algolia agent', () => {
57-
expect(client._ua).toEqual(
58-
expect.stringMatching(/.*; Node\.js \(.*\)$/g)
59-
);
55+
expect(client._ua).toEqual(expect.stringMatching(/.*; Node\.js \(.*\)$/g));
6056

6157
client.addAlgoliaAgent('Jest', '0.0.1');
6258

63-
expect(client._ua).toEqual(
64-
expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g)
65-
);
59+
expect(client._ua).toEqual(expect.stringMatching(/.*; Jest \(0\.0\.1\)$/g));
6660
});
6761
});
6862

@@ -71,9 +65,7 @@ describe('api', () => {
7165
expect(client.transporter).toEqual({
7266
algoliaAgent: {
7367
add: expect.any(Function),
74-
value: expect.stringContaining(
75-
`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`
76-
),
68+
value: expect.stringContaining(`Algolia for JavaScript (${apiClientVersion}); Search (${apiClientVersion});`),
7769
},
7870
baseHeaders: {
7971
'content-type': 'text/plain',
@@ -172,19 +164,19 @@ describe('api', () => {
172164
expect.objectContaining({
173165
'x-algolia-application-id': 'APP_ID',
174166
'x-algolia-api-key': 'API_KEY',
175-
})
167+
}),
176168
);
177169
expect(res2.headers).toEqual(
178170
expect.objectContaining({
179171
'x-algolia-application-id': 'APP_ID',
180172
'x-algolia-api-key': 'API_KEY',
181-
})
173+
}),
182174
);
183175
expect(res3.headers).toEqual(
184176
expect.objectContaining({
185177
'x-algolia-application-id': 'APP_ID',
186178
'x-algolia-api-key': 'API_KEY',
187-
})
179+
}),
188180
);
189181
});
190182

@@ -217,19 +209,19 @@ describe('api', () => {
217209
expect.objectContaining({
218210
'x-algolia-application-id': 'appId1',
219211
'x-algolia-api-key': 'apiKey1',
220-
})
212+
}),
221213
);
222214
expect(res2.headers).toEqual(
223215
expect.objectContaining({
224216
'x-algolia-application-id': 'appId2',
225217
'x-algolia-api-key': 'apiKey2',
226-
})
218+
}),
227219
);
228220
expect(res3.headers).toEqual(
229221
expect.objectContaining({
230222
'x-algolia-application-id': 'appId3',
231223
'x-algolia-api-key': 'apiKey3',
232-
})
224+
}),
233225
);
234226
});
235227
});
@@ -272,9 +264,7 @@ describe('search with legacy signature', () => {
272264
expect(req.path).toEqual('/1/indexes/*/queries');
273265
expect(req.method).toEqual('POST');
274266
expect(req.data).toEqual({
275-
requests: [
276-
{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' },
277-
],
267+
requests: [{ indexName: 'theIndexName', type: 'facet', facet: 'theFacet' }],
278268
});
279269
expect(req.searchParams).toStrictEqual(undefined);
280270
});

clients/algoliasearch-client-javascript/packages/client-common/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"test": "jest"
2424
},
2525
"devDependencies": {
26-
"@babel/preset-env": "7.25.3",
26+
"@babel/preset-env": "7.25.4",
2727
"@babel/preset-typescript": "7.24.7",
2828
"@types/jest": "29.5.12",
29-
"@types/node": "20.14.14",
29+
"@types/node": "22.5.0",
3030
"jest": "29.7.0",
3131
"jest-environment-jsdom": "29.7.0",
32-
"ts-jest": "29.2.4",
32+
"ts-jest": "29.2.5",
3333
"typescript": "5.5.4"
3434
},
3535
"engines": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { buildConfigs } from '../../base.rollup.config.js';
22

3-
import pkg from './package.json' assert { type: 'json' };
3+
import pkg from './package.json' with { type: 'json' };
44

55
export default buildConfigs(pkg);

clients/algoliasearch-client-javascript/packages/client-usage/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"@algolia/requester-node-http": "5.1.1"
5050
},
5151
"devDependencies": {
52-
"@types/node": "22.2.0",
53-
"rollup": "4.20.0",
52+
"@types/node": "22.4.1",
53+
"rollup": "4.21.0",
5454
"typescript": "5.5.4"
5555
},
5656
"engines": {

clients/algoliasearch-client-javascript/packages/monitoring/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"@algolia/requester-node-http": "5.1.1"
5050
},
5151
"devDependencies": {
52-
"@types/node": "22.2.0",
53-
"rollup": "4.20.0",
52+
"@types/node": "22.4.1",
53+
"rollup": "4.21.0",
5454
"typescript": "5.5.4"
5555
},
5656
"engines": {

0 commit comments

Comments
 (0)