Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/typeorm seeding deps update #8

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

ArtemMakhaydinov
Copy link
Contributor

@SlumberyDude
faker deprecated был заменен на @faker-js/faker последней версии
@types/faker удален
typeorm обновлен до 0.2.41 в последних патчах 0.2 версии тайп DeepPartial был изменен, в результате билд выдает ошибки:

➤ YN0000: │ packages/seeding/src/factories/seeder-entity.factory.ts:28:7
➤ YN0000: │ 
➤ YN0000: │   Error: Type '{}' is not assignable to type 'DeepPartial<Entity>'.
➤ YN0000: │ 
➤ YN0000: │   26 |   }
➤ YN0000: │   27 |
➤ YN0000: │ > 28 |   with(data: DeepPartial<Entity> = {}) {
➤ YN0000: │      |       ^
➤ YN0000: │   29 |     this.withData = { ...this.withData, ...data }
➤ YN0000: │   30 |
➤ YN0000: │   31 |     return this
➤ YN0000: │ 
➤ YN0000: │ 
➤ YN0000: │ packages/seeding/src/factories/seeder-entity.factory.ts:37:46
➤ YN0000: │ 
➤ YN0000: │   Error: No overload matches this call.
➤ YN0000: │          Overload 1 of 4, '(entities: DeepPartial<Entity>[], options?: SaveOptions | undefined): Promise<(DeepPartial<Entity> & Entity)[]>', gave the following error.
➤ YN0000: │            Argument of type 'Entity[]' is not assignable to parameter of type 'DeepPartial<Entity>[]'.
➤ YN0000: │              Type 'Entity' is not assignable to type 'DeepPartial<Entity>'.
➤ YN0000: │                Type 'ObjectLiteral' is not assignable to type 'DeepPartial<Entity>'.
➤ YN0000: │          Overload 2 of 4, '(entity: DeepPartial<Entity>, options?: SaveOptions | undefined): Promise<DeepPartial<Entity> & Entity>', gave the following error.
➤ YN0000: │            Argument of type 'Entity[]' is not assignable to parameter of type 'DeepPartial<Entity>'.
➤ YN0000: │ 
➤ YN0000: │   35 |     const items = Array.from(Array(count), () => this.generate())
➤ YN0000: │   36 |
➤ YN0000: │ > 37 |     const result = await this.repository.save(items)
➤ YN0000: │      |                                              ^
➤ YN0000: │   38 |
➤ YN0000: │   39 |     return count === 1 ? result[0] : result
➤ YN0000: │   40 |   }

@TorinAsakura TorinAsakura merged commit 07b07b4 into master Sep 26, 2023
6 checks passed
@TorinAsakura TorinAsakura deleted the feat/typeorm-seeding-deps-update branch September 26, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants