Skip to content

Commit 32f1771

Browse files
Merge #1255
1255: Move nested lib files to src root r=bidoubiwa a=bidoubiwa For a more consistent architecture the modules that were nested inside of the `lib` folder have been brought back to the root of the `src` folder as there was no reason they were nested there Tests file names were also updated: <img width="349" alt="Screenshot 2022-06-07 at 12 46 20" src="https://user-images.githubusercontent.com/33010418/172367718-0a83c69c-8fe8-4268-8fa2-c4c0ef0495dd.png"> So that we have the nice colored icons to quickly separated source files from testing files Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents c05a8d2 + 3ea7201 commit 32f1771

36 files changed

+49
-44
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const config = {
2323
testPathIgnorePatterns: [
2424
'meilisearch-test-utils',
2525
'env/',
26-
'token_tests.ts',
26+
'token.test.ts',
2727
],
2828
},
2929
{

src/browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export * from './types'
22
export * from './errors'
3-
export * from './lib'
4-
import { MeiliSearch } from './lib/clients/browser-client'
3+
export * from './indexes'
4+
import { MeiliSearch } from './clients/browser-client'
55

66
export { MeiliSearch }
77
export default MeiliSearch

src/lib/clients/browser-client.ts renamed to src/clients/browser-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Client } from './client'
2-
import { Config } from '../../types'
2+
import { Config } from '../types'
33

44
class MeiliSearch extends Client {
55
constructor(config: Config) {

src/lib/clients/client.ts renamed to src/clients/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
Result,
2525
TokenSearchRules,
2626
TokenOptions,
27-
} from '../../types'
27+
} from '../types'
2828
import { HttpRequests } from '../http-requests'
2929
import { TaskClient } from '../task'
3030

src/lib/clients/node-client.ts renamed to src/clients/node-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Client } from './client'
2-
import { Config, TokenSearchRules, TokenOptions } from '../../types'
2+
import { Config, TokenSearchRules, TokenOptions } from '../types'
33
import { Token } from '../token'
44

55
class MeiliSearch extends Client {

src/lib/http-requests.ts renamed to src/http-requests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'cross-fetch/polyfill'
22

3-
import { Config, EnqueuedTask } from '../types'
3+
import { Config, EnqueuedTask } from './types'
44

55
import {
66
MeiliSearchError,
77
httpResponseErrorHandler,
88
httpErrorHandler,
9-
} from '../errors'
9+
} from './errors'
1010

1111
import { addTrailingSlash, addProtocolIfNotPresent } from './utils'
1212

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export * from './types'
22
export * from './errors'
3-
export * from './lib'
4-
import { MeiliSearch } from './lib/clients/node-client'
3+
export * from './indexes'
4+
import { MeiliSearch } from './clients/node-client'
55

66
export { MeiliSearch }
77
export default MeiliSearch

src/lib/indexes.ts renamed to src/indexes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
'use strict'
99

10-
import { MeiliSearchError } from '../errors'
10+
import { MeiliSearchError } from './errors'
1111

1212
import {
1313
Config,
@@ -35,7 +35,7 @@ import {
3535
DisplayedAttributes,
3636
TypoTolerance,
3737
Result,
38-
} from '../types'
38+
} from './types'
3939
import { removeUndefinedFromObject } from './utils'
4040
import { HttpRequests } from './http-requests'
4141
import { TaskClient } from './task'

src/lib/index.ts

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

src/lib/task.ts renamed to src/task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { MeiliSearchTimeOutError } from '../errors'
2-
import { Config, Task, WaitOptions, TaskStatus, Result } from '../types'
1+
import { MeiliSearchTimeOutError } from './errors'
2+
import { Config, Task, WaitOptions, TaskStatus, Result } from './types'
33
import { HttpRequests } from './http-requests'
44
import { sleep } from './utils'
55

0 commit comments

Comments
 (0)