GithubHelp home page GithubHelp logo

robinck / typeorm-fixtures Goto Github PK

View Code? Open in Web Editor NEW
503.0 5.0 47.0 1.44 MB

:pill: Fixtures loader for typeorm πŸ‡ΊπŸ‡¦

Home Page: https://robinck.github.io/typeorm-fixtures/

License: MIT License

TypeScript 85.99% JavaScript 14.01%
fixtures typeorm orm cli typescript faker fixture-loader typeorm-fixtures

typeorm-fixtures's Introduction

TypeORM fixtures cli

CircleCI GitHub CI OpenCollective Coverage Status Version License Backers on Open Collective Sponsors on Open Collective

Relying on faker.js, typeorm-fixtures-cli allows you to create a ton of fixtures/fake data for use while developing or testing your project. It gives you a few essential tools to make it very easy to generate complex data with constraints in a readable and easy to edit way, so that everyone on your team can tweak the fixtures if needed.

Table of Contents

Install

NPM

npm install typeorm-fixtures-cli --save-dev

Yarn

yarn add typeorm-fixtures-cli --dev

Development Setup

# install dependencies
npm install

# build dist files
npm run build

Example

fixtures/Comment.yml

entity: Comment
items:
  comment{1..10}:
    fullName: '{{name.firstName}} {{name.lastName}}'
    email: '{{internet.email}}'
    text: '{{lorem.paragraphs}}'
    post: '@post*'

fixtures/Post.yml

entity: Post
items:
  post1:
    title: '{{name.title}}'
    description: '{{lorem.paragraphs}}'
    user: '@user($current)'
  post2:
    title: '{{name.title}}'
    description: '{{lorem.paragraphs}}'
    user: '@user($current)'

fixtures/User.yml

entity: User
items:
  user1:
    firstName: '{{name.firstName}}'
    lastName: '{{name.lastName}}'
    email: '{{internet.email}}'
    profile: '@profile1'
    __call:
      setPassword:
        - foo
  user2:
    firstName: '{{name.firstName}}'
    lastName: '{{name.lastName}}'
    email: '{{internet.email}}'
    profile: '@profile2'
    __call:
      setPassword:
        - foo

fixtures/Profile.yml

entity: Profile
items:
  profile1:
    aboutMe: <%= ['about string', 'about string 2', 'about string 3'].join(", ") %>
    skype: skype-account>
    language: english
  profile2:
    aboutMe: <%= ['about string', 'about string 2', 'about string 3'].join(", ") %>
    skype: skype-account
    language: english

Creating Fixtures

The most basic functionality of this library is to turn flat yaml files into objects

entity: User
items:
  user0:
    username: bob
    fullname: Bob
    birthDate: 1980-10-10
    email: [email protected]
    favoriteNumber: 42

  user1:
    username: alice
    fullname: Alice
    birthDate: 1978-07-12
    email: [email protected]
    favoriteNumber: 27

Fixture Ranges

The first step is to let create many copies of an object for you to remove duplication from the yaml file.

You can do that by defining a range in the fixture name:

entity: User
items:
  user{1..10}:
    username: bob
    fullname: Bob
    birthDate: 1980-10-10
    email: [email protected]
    favoriteNumber: 42

Now it will generate ten users, with IDs user1 to user10. Pretty good but we only have 10 bobs with the same name, username and email, which is not so fancy yet.

Fixture Reference

You can also specify a reference to a previously created list of fixtures:

entity: Post
items:
  post1:
    title: 'Post title'
    description: 'Post description'
    user: '@user1'

Fixture Lists

You can also specify a list of values instead of a range:

entity: Post
items:
  post{1..10}:
    title: 'Post title'
    description: 'Post description'
    user: '@user($current)'

In the case of a range (e.g. user{1..10}), ($current) will return 1 for user1, 2 for user2 etc.

The current iteration can be used as a string value:

entity: Post
items:
  post{1..10}:
    title: 'Post($current)'
    description: 'Post description'

Post($current) will return Post1 for post1, Post2 for post2 etc.

You can mutate this output by using basic math operators:

entity: Post
items:
  post{1..10}:
    title: 'Post($current*100)'
    description: 'Post description'

Post($current*100) will return Post100 for post1, Post200 for post2 etc.

Calling Sync and Async Methods

Sometimes though you need to call a method to initialize some more data, you can do this just like with properties but instead using the method name and giving it an array of arguments.

entity: User
items:
  user{1..10}:
    username: bob
    fullname: Bob
    birthDate: 1980-10-10
    email: [email protected]
    favoriteNumber: 42
    __call:
      setPassword:
        - foo

Handling Relations

entity: User
items:
  user1:
    # ...

entity: Group
items:
  group1:
    name: '<{names.admin}>'
    owner: '@user1'
    members:
      - '@user2'
      - '@user3'

If you want to create ten users and ten groups and have each user own one group, you can use ($current) which is replaced with the current ID of each iteration when using fixture ranges:

entity: User
items:
  user1:
    # ...

entity: Group
items:
  group{1..10}:
    name: 'name'
    owner: '@user($current)'
    members:
      - '@user2'
      - '@user3'

If you would like a random user instead of a fixed one, you can define a reference with a wildcard:

entity: User
items:
  user1:
    # ...

entity: Group
items:
  group{1..10}:
    name: 'name'
    owner: '@user*'
    members:
      - '@user2'
      - '@user3'

or

entity: User
items:
  user1:
    # ...

entity: Group
items:
  group{1..10}:
    name: 'name'
    owner: '@user{1..2}' # @user1 or @user2
    members:
      - '@user2'
      - '@user3'

Advanced Guide

Parameters

You can set global parameters that will be inserted everywhere those values are used to help with readability. For example:

entity: Group
parameters:
  names:
    admin: Admin
items:
  group1:
    name: '<{names.admin}>' # <--- set Admin
    owner: '@user1'
    members:
      - '@user2'
      - '@user3'

Faker Data

This library integrates with the faker.js library. Using {{foo}} you can call Faker data providers to generate random data.

Let's turn our static bob user into a randomized entry:

entity: User
items:
  user{1..10}:
    username: '{{internet.userName}}'
    fullname: '{{name.firstName}} {{name.lastName}}'
    birthDate: '{{date.past}}'
    email: '{{internet.email}}'
    favoriteNumber: '{{datatype.number}}'
    __call:
      setPassword:
        - foo

EJS templating

This library integrates with the EJS

entity: Profile
items:
  profile1:
    aboutMe: <%= ['about string', 'about string 2', 'about string 3'].join(", ") %>
    skype: skype-account>
    language: english

Load Processor

Processors allow you to process objects before and/or after they are persisted. Processors must implement the: IProcessor

import { IProcessor } from 'typeorm-fixtures-cli';

Here is an example:

processor/UserProcessor.ts

import { IProcessor } from 'typeorm-fixtures-cli';
import { User } from '../entity/User';

export default class UserProcessor implements IProcessor<User> {
  preProcess(name: string, object: any): any {
    return { ...object, firstName: 'foo' };
  }

  postProcess(name: string, object: { [key: string]: any }): void {
    object.name = `${object.firstName} ${object.lastName}`;
  }
}

fixture config fixtures/user.yml

entity: User
processor: ../processor/UserProcessor
items:
  user1:
    firstName: '{{name.firstName}}'
    lastName: '{{name.lastName}}'
    email: '{{internet.email}}'

Alternative Javascript Syntax for CommonJS

If you need to run the fixtures under CommonJS and are having problems using typescript with the load processors, this alternative example should work for you:

processor/UserProcessor.js

class UserProcessor {
  preProcess(name, obj) {
    return { ...obj, firstName: 'foo' };
  }

  postProcess(name, obj) {
    obj.name = `${obj.firstName} ${obj.lastName}`;
  }
}

module.exports = { default: UserProcessor }

Entity Schemas

If you are using Entity Schemas in typeorm, you are likely to encounter problems with the __call feature in typeorm-fixtures due to the way the entity object is constructed.

As a workaround, you should be able to duplicate the same method functionality in the Load Processor preProcess method (Note that the object passed in will be a plain object and not your entity object).

Usage

Usage: fixtures load [options] <path> Fixtures folder/file path

Use -h or --help to show details of options: fixtures load -h
If entities files are in typescript (like typeorm)

This CLI tool is written in javascript and to be run on node. If your entity files are in typescript, you will need to transpile them to javascript before using CLI. You may skip this section if you only use javascript.

You may setup ts-node in your project to ease the operation as follows:

Install ts-node:

npm install ts-node --save-dev

Add typeorm command under scripts section in package.json

"scripts": {
    ...
    "fixtures": "fixtures-ts-node-commonjs"
}

For ESM projects add this instead:

"scripts": {
    ...
    "fixtures": "fixtures-ts-node-esm"
}
Require multiple additional modules

If you're using multiple modules at once (e.g. ts-node and tsconfig-paths) you have the ability to require these modules with multiple require flags. For example:

fixtures load ./fixtures --dataSource=./dataSource.ts --sync --require=ts-node/register --require=tsconfig-paths/register

Programmatically loading fixtures

Although typeorm-fixtures-cli is intended to use as a CLI, you can still load fixtures via APIs in your program.

For example, the below code snippet will load all fixtures exist in ./fixtures directory:

import * as path from 'path';
import { Builder, fixturesIterator, Loader, Parser, Resolver } from 'typeorm-fixtures-cli/dist';
import { createConnection, getRepository } from 'typeorm';
import { CommandUtils } from 'typeorm/commands/CommandUtils';

const loadFixtures = async (fixturesPath: string) => {
  let dataSource: DataSource | undefined = undefined;

  try {
    dataSource = await CommandUtils.loadDataSource(dataSourcePath);
    await dataSource.initialize();
    await dataSource.synchronize(true);

    const loader = new Loader();
    loader.load(path.resolve(fixturesPath));

    const resolver = new Resolver();
    const fixtures = resolver.resolve(loader.fixtureConfigs);
    const builder = new Builder(connection, new Parser(), false);

    for (const fixture of fixturesIterator(fixtures)) {
      const entity: any = await builder.build(fixture);
      await dataSource.getRepository(fixture.entity).save(entity);
    }
  } catch (err) {
    throw err;
  } finally {
    if (dataSource) {
      await dataSource.destroy();
    }
  }
};

loadFixtures('./fixtures')
  .then(() => {
    console.log('Fixtures are successfully loaded.');
  })
  .catch((err) => {
    console.log(err);
  });

Samples

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

MIT Β© Igor Ognichenko

typeorm-fixtures's People

Contributors

5t111111 avatar alexgeorgopoulos avatar braaar avatar dependabot-preview[bot] avatar dependabot[bot] avatar doomsower avatar ejose19 avatar fstoerkle avatar greenkeeper[bot] avatar imnotjames avatar johannesschobel avatar kevin-lot avatar kkent030315 avatar ladislasdellinger avatar leosuncin avatar nmacherey avatar poldridge avatar robinck avatar sebastiaanviaene avatar slukes avatar tudddorrr avatar urg avatar veiico avatar wit1312 avatar woodcockjosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

typeorm-fixtures's Issues

How to set embedded values?

Software Version(s)
typeorm-fixtures 1.7.0
Node 14.4.0
Yarn 1.22.4
Operating System Debian 10
$ node -r tsconfig-paths/register -r ts-node/register node_modules/.bin/fixtures --config ./apps/my-api/src/db.config.ts --sync ./fixtures
Progress  [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘] 20% | ETA: 1s | 1/5 user1 
Fail fixture loading: entity[propertyPath][this.propertyName] is not a function
TypeError: entity[propertyPath][this.propertyName] is not a function
    at EntityListenerMetadata.callEntityEmbeddedMethod (/nest-pkgs/src/metadata/EntityListenerMetadata.ts:89:52)
    at EntityListenerMetadata.execute (/nest-pkgs/src/metadata/EntityListenerMetadata.ts:73:14)
    at /nest-pkgs/src/subscriber/Broadcaster.ts:38:54
    at Array.forEach (<anonymous>)
    at Broadcaster.broadcastBeforeInsertEvent (/nest-pkgs/src/subscriber/Broadcaster.ts:36:44)
    at /nest-pkgs/src/persistence/SubjectExecutor.ts:211:81
    at Array.forEach (<anonymous>)
    at SubjectExecutor.broadcastBeforeEventsForAll (/nest-pkgs/src/persistence/SubjectExecutor.ts:211:33)
    at SubjectExecutor.<anonymous> (/nest-pkgs/src/persistence/SubjectExecutor.ts:108:38)
    at step (/nest-pkgs/node_modules/typeorm/node_modules/tslib/tslib.js:141:27)
error Command failed with exit code 1.
entity: User
items:
    user1:
        authEmail: [email protected]
        auth.email: [email protected]
        auth.Email: [email protected]
        auth:
            authEmail: [email protected]
        __call:
            auth.setEmailVerified:
                - true
@Entity()
export class User {
    @PrimaryGeneratedColumn('uuid')
    uuid?: string;

    @ValidateNested()
    @Column(() => LocalAuth)
    auth?: LocalAuth;
}
export abstract class LocalAuth {
    @IsEmail()
    @Index({unique: true})
    @Column({comment: 'email = username', unique: true})
    email?: string;

    @BeforeInsert()
    emailToLowerCase() {
        this.email = this.email?.toLowerCase();
    }

    @IsDate()
    @Column({nullable: true})
    email_verified_at?: Date;

    setEmailVerified(verified: boolean) {
        if (verified) {
            this.email_verified_at = new Date();
        } else {
            this.email_verified_at = undefined;
        }
        return this;
    }
}

Set Relations in Processor

It would be very nice to be able to set references in the processor to allow more complex assignments of the relations. It would also be nice to have access to $current in the processor without extracting it from name parameter. This would allow things like:

items:
  a1:
    order: '0'
    parent: '@p1'
  a2:
    order: '1'
    parent: '@p1'
  a3:
    order: '2'
    parent: '@p1'
  a4:
    order: '3'
    parent: '@p1'
  a5:
    order: '4'
    parent: '@p1'
  a6:
    order: '0'
    parent: '@p2'

to be replaced by

processor:
object.order = current % 5;
object.parent = `@p${current%5}`;


items:
  a{1..1}:

Pick random string in array

Is it possible to use a random string from predefined values? It would be useful for enum fields, for example

Prevent fixture from being loaded in processor

I have some entities being inserted via triggers in DB, and having a unique index (independent of the PK). Using fixtures, it's not possible to know what the row id will be in before, but I would like to use it later on to append relations on those entities.

So far I have tried creating a load processor to read the id and perform the update there, using the unique index columns. The update is done, but, I get a weird error afterwards:

Fail fixture loading: Could not find any entity of type "ProjectMap" matching: {
    "where": {}
}

My preProcess function:

  async preProcess(name: string, obj: ProjectMap): Promise<ProjectMap> {
    const repository = getConnection().getRepository(ProjectMap);
    const { id } = await repository.findOneOrFail({ select: ['id'], where: { method: obj.method, resourceId: obj.resource.id } });
    obj.id = id;

    await repository.save(obj);

    return derived;
  }

I cannot find how the save fails afterwards, however perhaps I could skip the library's save by returning null?

Roadmap to 1.0

  • __calls
  • <(current())>
  • <{parameters}>
  • ejs
  • Faker.js
  • Documentation
  • unit tests

Specifying connection does not seem to work.

npx fixtures ./fixtures --config ormconfig.js --connection Diligence

UnhandledPromiseRejectionWarning: ConnectionNotFoundError: Connection "default" was not found.

npx fixtures ./fixtures --config ormconfig.js -cn Diligence

TypeOrm config /Users/samcong/code/repo/n not found

Config

module.exports = [
{
name: "Diligence",
type: "mssql",
host: "localhost",
port: 11433,
database: "Diligence",
username: "sa",
password: "password",
entities: ["src/models/**/*.ts"]
}
];

How to use it with nullable self-referential relations?

I have a category entity set up like in the example that optionally points to another category, creating a parent/child relationship. The topmost categories don't have a parent (so its parent attribute is nullable)

My fixture looks like this:

entity: Category
items:
  category1:
    name: 'first'
    parent: null
    sortId: 1

I get an error when it tries to insert the fixture, because it tries to insert a second, empty category.

I've traced through the code to see what it's doing and it converts the {parent:null} from the fixture to an empty object {parent: {}} in the Entity.

[Bug]

Your Environment

We have the following setup and when we run the fixtures we get pages of UnhandledPromiseRejectionWarning output. It seems to be related to bcryptjs. We have a target in a make file which calls a package.json script specifying which fixtures orm config file to use:

make file command that calls the package.json scirpt
npm run fixtures -- --config tests/ormconfig_docker-local.yml

package.json script
"fixtures": "rm -f .env && fixtures ./tests/fixtures --require=ts-node/register",

ormconfig_docker-local.yml

- name: default
  type: postgres
  host: database
  port: 5432
  database: xxx
  username: xxx
  password: xxx
  synchronize: false
  logging: false
  entities:
    - ./server/entities/**/*.ts
  cli:
    entitiesDir: ./server/entities
Software Version(s)
typeorm-fixtures "typeorm-fixtures-cli": "^1.4.2"
bcryptijs "bcryptjs": "^2.4.3"
Node 12.14.1
npm/Yarn 6.13.4
Operating System ubuntu 18.04
(node:33) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4899)
(node:33) UnhandledPromiseRejectionWarning: Error: Illegal arguments: function, undefined
    at _async (/app/node_modules/bcryptjs/dist/bcrypt.js:214:46)
    at /app/node_modules/bcryptjs/dist/bcrypt.js:223:17
    at new Promise (<anonymous>)
    at User.bcrypt.hash (/app/node_modules/bcryptjs/dist/bcrypt.js:222:20)
    at Promise (internal/util.js:275:30)
    at new Promise (<anonymous>)
    at User._hashAsync (internal/util.js:274:12)
    at _loop_1 (/app/src/TransformOperationExecutor.ts:154:47)
    at TransformOperationExecutor.transform (/app/node_modules/class-transformer/TransformOperationExecutor.js:260:17)
    at _loop_1 (/app/src/TransformOperationExecutor.ts:246:43)
    at TransformOperationExecutor.transform (/app/node_modules/class-transformer/TransformOperationExecutor.js:260:17)
    at ClassTransformer.plainToClassFromExist (/app/src/ClassTransformer.ts:55:25)
    at Object.plainToClassFromExist (/app/src/index.ts:48:29)
    at Builder.<anonymous> (/app/node_modules/typeorm-fixtures-cli/src/Builder.ts:78:22)
    at Generator.next (<anonymous>)
    at /app/node_modules/typeorm-fixtures-cli/dist/Builder.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/app/node_modules/typeorm-fixtures-cli/dist/Builder.js:3:12)
    at Builder.build (/app/node_modules/typeorm-fixtures-cli/dist/Builder.js:26:16)
    at Function.loadFixtures (/app/tests/support/utils.ts:232:51)
    at process._tickCallback (internal/process/next_tick.js:68:7)�Á��

Order of fixture save/insert

Hi,

I've got an application where database schema is designed to store immutable data and every new row represents new revision of the data. Thus the order of rows is very important.

I noticed after using this package that because of dependency resolving some of the entities I created were not being saved to database in the same order specified in the .yml file.

I thought that one way could be adding an option in where previous node would be set to dependency.

More flexible implementation of this would be to allow Fixture item tell that it depends on previous item in Fixture.yml

[Question] Is it possible to use specific field of the related object?

Hi,

There are many examples where related object is fully inserted into the parent object but, sometimes, you need just one field from the related object (e.g. id). Is it possible to do something like:

profileId: `@profile5.id`

I know I can do it using processors but it looks a bit ugly, imo.

Thank you.

Many to many always seems to be failing

I have a manyToMany relationship in one of my entities and if I comment it out it works fine: something like the following:

@ManyToMany(type => Subject, subject => subject.tutors)
@JoinTable()
subjects: Subject[]

after trying to run the fixture I get:

Fail fixture loading: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded

Has anyone tried getting fixtures to work with ManyToMany relationships?

Cannot find module 'joi' after upgrade to 1.4.0

I upgraded to 1.4.0 and get a "Cannot find module 'joi' after upgrade to 1.4.0" error when running fixtures.
When searching for the usage of the removed dependency joi I find it in typeorm-fixtures-cli/dist/schema/jFixturesSchema.js and .../dist/Loader
The typeorm-fixtures-cli/package.json has the correct version of 1.4.0 though with @hapi/joi in dependencies.

It seems like the npm package ships with an old version of the source code.

ManyToMany Relations error

"typeorm-fixtures-cli": "^1.3.5"

Getting error when run fixtures Ads.yml:

Fail fixture loading: Entity metadata for Category#ads was not found.

maybe is bug?

@Entity('ad')
export class Ad {
  @PrimaryGeneratedColumn
  id: number;
  @Column()
  title: string;
  @ManyToMany(type => Category, category => category.ads)
  @JoinTable({ name: 'ad_category' })
  categories: Category[];
}
@Entity('category')
export class Category {
  @PrimaryGeneratedColumn()
  id: number;
  @Column)
  name: string;
  @ManyToMany(type => Ad, ad => ad.categories)
  ads: Ad[];
}

Ads.yml

entity: Ad
items:
  ad{1..100}:
    title: '{{name.jobType}}'
    categories:
      category1:
        name: '{{name.jobArea}}'

[Feature Request] Seeded random

I'd like my fixtures to be generated randomly, but with a seed.
For faker fields, I use faker.seed(777).
However, this doesn't work with "*" relations.
I tried to use seedrandom package and replace global random, but it doesn't work with global lodash instance which this package uses in ReferenceParser. So I hardcoded seedrandom like this: https://github.com/doomsower/typeorm-fixtures/blob/70cdea8d407fa8d9b9b0f3f29e5a12231ffa875c/src/parsers/ReferenceParser.ts#L14

I think this is a nice feature, but currently there's no mechanism to pass params to parsers, as everything is hardcoded.

[FEATURE REQUEST | WIP | FORK] Resolve promises for lazy loading relations

Hi,

I've created a fork to work on the ability to resolve promises for lazy loaded relations in typeorm. The idea is to have the same principle as resolving references but adding a promise.resolve once it has been resolved.

https://github.com/getbigger-io/typeorm-fixtures/blob/master/src/parsers/PromiseReferenceParser.ts

I am facing issues in the Builder expecially regarding the usage of the class-transformer package. The current code is the following:

plainToClassFromExist(entity, data, { ignoreDecorators: true }) -> decorator are ignored and the class-transformer produces the following plaintToClass transformation:

MyEntity {
  id: 'c0ed46a6-7c84-4879-9bbb-4123897eb122',
  name: 'DEMO',
  __promise_property__: Promise { <pending> }
}

I fully understand why the option is there, but I cannot find any solution to get rid of this and get the resolved promise in the transformation output.

If you have any idea on how we can easilly solve this step and get the proper property names in the output it would be great !
Thanks

Setting up a Seed to generate replicable fixtures

I've been trying to check the possibility to set the generation seed for the fixtures, so they can be reproducible in tests, however I haven't seen the faker.seed() call anywhere in the code.

Is there any possibility to add some sort of configuration to the project so tests can be reproducible?
This way, fixtures can be loaded before tests and tests can be reproducible.

Otherwise, each time fixtures are run, the values in the database get updated

An in-range update of @types/chai-as-promised is breaking the build 🚨

The devDependency @types/chai-as-promised was updated from 7.1.1 to 7.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/chai-as-promised is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of tslint-immutable is breaking the build 🚨

The devDependency tslint-immutable was updated from 5.3.3 to 5.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

tslint-immutable is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

For testing purposes and recommendations

Hey. Thank you for this great project!

My main intention with this lib is to load fixtures for automated testing on a Nest project.
But after reading the following statement in the README, it has brought me doubts about the purpose of this library:

Although typeorm-fixtures-cli is intended to use as a CLI, you can still load fixtures via APIs in your program.

Loading the fixtures using the CLI means the data will be loaded once for the entire testing suite.
One general practice for automated testing is to isolate testing data between testing cases.
I'm trying to figure out why programmatically loading is not faced as the first option here. πŸ™ƒ

Cannot execute operation on "default" connection because connection is not yet established

I have a makefile with a command:

db-sync: NODE_ENV=$(NODE_ENV) $(NPM_BIN)/fixtures --config ./ormconfig.js --sync --debug ./data/fixtures

When I run this code, I get:
Fail fixture loading: Unexpected token { (node:53075) UnhandledPromiseRejectionWarning: CannotExecuteNotConnectedError: Cannot execute operation on "default" connection because connection is not yet established. at new CannotExecuteNotConnectedError (/Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/typeorm/error/CannotExecuteNotConnectedError.js:10:28) at Connection.<anonymous> (/Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/typeorm/connection/Connection.js:173:35) at step (/Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/tslib/tslib.js:136:27) at Object.next (/Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/tslib/tslib.js:117:57) at /Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/tslib/tslib.js:110:75 at new Promise (<anonymous>) at Object.__awaiter (/Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/tslib/tslib.js:106:16) at Connection.close (/Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/typeorm/connection/Connection.js:168:24) at Object.<anonymous> (/Users/marcio/Development/projects/personal/typescript-express-di-orm/node_modules/typeorm-fixtures-cli/dist/cli.js:111:37) at Generator.next (<anonymous>) (node:53075) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:53075) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Fun fact: I use the same configuration to run fixtures before my unit-tests programmatically and works well

ormconfig.js
{ "name":"default", "type":"mysql", "host":"127.0.0.1", "port":3306, "username":"blablabla", "password":"blablabla", "database":"blablabla", "ssl":false, "entityPrefix":"", "synchronize":true, "dropSchema":true, "logging":[ "query", "error", "schema", "warn", "info", "log" ], "extra":{ "ssl":false }, "autoSchemaSync":true, "entities":[ "./src/entities/*.*" ], "migrations":[ "./src/migrations/*.*" ], "subscribers":[ "./src/subscribers/*.*" ], "cli":{ "entitiesDir":"./src/entities", "migrationsDir":"./src/migrations", "subscribersDir":"./src/subscribers" } }

Do you guys have any idea what could be wrong? For me, this seems the fixture is trying to run before have a opened connection. But make no sense because all logic is inside the then of createConnection

Feature request: add process.env to parameters

I'm generating my fixtures programmatically and I'd like to use environment variables in fixtures like this: id: '<{process.env.ADMIN_USER_ID}>'. Currently I have to manually modify parameters like this:

  loader.load(path.resolve(__dirname, process.env.NODE_ENV));
  const configs = loader.fixtureConfigs;
  configs.forEach((cfg) => {
    if (cfg.entity === 'User') {
      set(cfg, 'cfg.parameters.userIds.admin', process.env.ADMIN_USER_ID);
    }
  });

It would be nice to have process.env added to parameters by default. I've looked at the sources and could not decide where it fits.

[Bug] "fixtures" command not found

I have installed this package following the documentation with:

npm install typeorm-fixtures-cli --save-dev

I also have created a fixture file in fixtures/User.yml with:

entity: User
items:
    user1:
        username: '[email protected]'

But when I try to run the fixtures command I get a command not found error

root@ed0c1271ba48:/application# fixtures
bash: fixtures: command not found

I am running this on a node:12.16.2 Docker image

Do I need to do anything else after installing the package?

Thank you very much.

An in-range update of conventional-changelog-cli is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


The devDependency conventional-changelog-cli was updated from 2.0.33 to 2.0.34.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

conventional-changelog-cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: build: Your tests failed on CircleCI (Details).

Commits

The new version differs by 3 commits.

  • c5ae3ab Publish
  • 6b0ffec build: keep optional appveyor for now (#640)
  • 46311d2 fix(deps): address CVE in meow (#642)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[Bug] TypeOrm Lazy relations are not properly handled

If you have relations defined as lazy, i.e. like:

@Entity()
class User {
  @OneToOne('Profile', 'user')
  profile: Promise<Profile>
}

Then when you run fixtures - all relation fields are nulls.
No exceptions thrown during fixtures loading.

TypeOrm Lazy Relations doc: https://typeorm.io/#/eager-and-lazy-relations/lazy-relations

Your Environment

Software Version(s)
typeorm 0.2.25
typeorm-fixtures 1.6.0
Node v12.16.3
npm/Yarn 6.14.5
Operating System Linux

Using current as part of string value

I was wondering if it's possible to use the current iteration as a string value in a field instead of just referencing relations. Like this:

entity: User
items:
  user{1..10}:
    firstName: '{{name.firstName}}'
    lastName: '{{name.lastName}}'
    email: 'email{{current}}@gmail.com'

This way all the fixtures will have [email protected] -> [email protected]

An in-range update of commitlint is breaking the build 🚨

There have been updates to the commitlint monorepo:

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the commitlint group definition.

commitlint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: build: Your tests failed on CircleCI (Details).

Commits

The new version differs by 39 commits.

  • c17420d v8.1.0
  • ca19d70 chore: update dependency lodash to v4.17.14 (#724)
  • 5757ef2 build(deps): bump lodash.template from 4.4.0 to 4.5.0 (#721)
  • 5b5f855 build(deps): bump lodash.merge from 4.6.0 to 4.6.2 (#722)
  • 4cb979d build(deps): bump lodash from 4.17.11 to 4.17.13 (#723)
  • a89c1ba chore: add devcontainer setup
  • 9aa5709 chore: pin dependencies (#714)
  • c9ef5e2 chore: centralize typescript and jest setups (#710)
  • c9dcf1a chore: pin dependencies (#708)
  • 6a6a8b0 refactor: rewrite top level to typescript (#679)
  • 0fedbc0 chore: update dependency @types/jest to v24.0.15 (#694)
  • 0b9c7ed chore: update dependency typescript to v3.5.2 (#695)
  • 4efb34b chore: update dependency globby to v10 (#705)
  • 804af8b chore: update dependency lint-staged to v8.2.1 (#696)
  • 9075844 fix: add explicit dependency on chalk (#687)

There are 39 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Roadmap to 2.0

  • $ref support (fixture scope)
  • config support
  • configure faker locale (implemented in 1.8.0)
  • optional data
  • reference to property
  • extend fixtures file
  • logger / debug
  • integration tests
  • class-transformer support
  • require option for registred ts-node and other
  • support tree repository
  • optional ignoreDecorators [true/false] #87

Stuck in using this library with nestjs for e2e testing

Hi. Thank you for this awesome project.
I'm trying to use it with nestjs for e2e testing and i keep getting this error.

TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
    test/test.utils.ts:113:11 - error TS2571: Object is of type 'unknown'.

    113           entity.constructor.name,
                  ~~~~~~
    test/test.utils.ts:114:17 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'DeepPartial<{}>'.

    114         )).save(entity);

/test/test.utils.ts

import { Injectable } from "@nestjs/common";
import * as fs from "fs";
import * as path from "path";
import {
  Builder,
  fixturesIterator,
  Loader,
  Parser,
  Resolver,
} from "typeorm-fixtures-cli/dist";
import { DatabaseService } from "../src/database/database.service";

@Injectable()
export class TestUtils {
  databaseService: DatabaseService;

  constructor(databaseService: DatabaseService) {
    if (process.env.NODE_ENV !== "test") {
      throw new Error("ERROR-TEST-UTILS-ONLY-FOR-TESTS");
    }
    this.databaseService = databaseService;
  }

  async loadFixtures(fixturesPath: string) {
    const connection = await this.databaseService.connection;
    try {
      const loader = new Loader();
      loader.load(path.resolve("./fixtures/User.yml"));

      const resolver = new Resolver();
      const fixtures = resolver.resolve(loader.fixtureConfigs);
      const builder = new Builder(connection, new Parser());

      for (const fixture of fixturesIterator(fixtures)) {
        const entity = await builder.build(fixture);
        (await this.databaseService.getRepository(
          entity.constructor.name,
        )).save(entity);
      }
    } catch (err) {
      throw err;
    } finally {
      if (connection) {
        await connection.close();
      }
    }
  }
}

/src/database/database.service.ts

import { Injectable } from "@nestjs/common";
import { InjectConnection } from "@nestjs/typeorm";
import { Connection } from "typeorm";

@Injectable()
export class DatabaseService {
  constructor(@InjectConnection() public connection: Connection) {}

  async getRepository<T>(entity) {
    return this.connection.getRepository(entity);
  }
}

/test/fixtures/User.yml

entity: User
items:
  user1:
    name: '{{name.firstName}}'
    email: '{{internet.email}}'
    password: 'password',
  user2:
    name: '{{name.firstName}}'
    email: '{{internet.email}}'
    password: 'password',

Any help would be appreciated!

Add config loading from ormconfig.ts in root directory

we use ormconfig.ts because it is most flexible for configuration TypeOrm
npx fixtures -c ormconfig.ts database/fixtures
output

Fail fixture loading: Unexpected token {
(node:32337) UnhandledPromiseRejectionWarning: ConnectionNotFoundError: Connection "default" was not found.

[Bug] PreProcess hangs with programmatic setup

Context:
I have a relation like so:

Sport.ts

import { Field, ObjectType } from 'type-graphql';
import { Column, Entity, OneToMany, Unique } from 'typeorm';

import { TimeFrame } from '..';
import Base from '../Base';

@ObjectType()
@Entity({ name: 'sports' })
export default class Sport extends Base {
  @Column({ type: 'text' })
  label: string;

  @Field(() => [TimeFrame])
  @OneToMany(() => TimeFrame, (timeFrame) => timeFrame.sport, { lazy: true })
  timeFrames: TimeFrame[];
}

TimeFrame.ts

import { Field, ObjectType } from 'type-graphql';
import { Column, Entity, JoinTable, ManyToMany, ManyToOne, OneToMany } from 'typeorm';

import { Sport } from '..';
import Base from '../Base';

@ObjectType()
@Entity({ name: 'time_frames' })
export default class TimeFrame extends Base {
  @Column({ type: 'text' })
  label: string;

  @Field(() => Sport)
  @ManyToOne(() => Sport, (sport) => sport.timeFrames, { lazy: true })
  sport: Sport;
  @Column({ nullable: false })
  sportId: string;
}

In my timeFrame fixture, I need to access sportId and not just sport. To solve, I want to implement a preprocessor to set the ID based on the sport relation.
With programmatic setup, if I add a preprocessor it just hangs while building the entity.

loadFixtures.ts

import * as path from 'path';

import { Connection, getRepository } from 'typeorm';
import {
  Builder,
  IEntity,
  Loader,
  Parser,
  Resolver,
} from 'typeorm-fixtures-cli/dist';

import testConnection from '../../testUtils/testConnection';

import { asyncForEach } from './../../utils/helpers';

interface ICreatedFixtures {
  [entity: string]: IEntity;
}
interface IFixtures {
  conn: Connection;
  createdFixtures: ICreatedFixtures;
}

const loadFixtures = async(fixtureFiles: string[]): Promise<IFixtures> => {
  const conn = await testConnection();
  const loader = new Loader();
  fixtureFiles.forEach((file) => {
    loader.load(path.resolve(`src/__spec__/fixtures/${file}.yml`));
  });

  const resolver = new Resolver();
  const fixtures = resolver.resolve(loader.fixtureConfigs);
  const builder = new Builder(conn, new Parser());

  const createdFixtures: ICreatedFixtures = {};
  await asyncForEach(fixtures, async(fixture) => {
    console.log('before build', fixture);

    const entity = await builder.build(fixture);
    console.log('after build');
    const { tableName } = conn.manager.getRepository(fixture.entity).metadata;

    await conn.manager.query(`DELETE FROM ${tableName}`);

    createdFixtures[fixture.name] = await getRepository(entity.constructor.name).save(entity);
  });

  return { conn, createdFixtures };
};

export default loadFixtures;

timeFrames.yml

entity: TimeFrame
processor: ../processors/TimeFrameProcessor
items:
  timeFrame:
    label: Game
    sport: '@sport'
    idx: 0

TimeFrameProcessor.ts

import { IProcessor } from 'typeorm-fixtures-cli/dist';

import { TimeFrame } from '../../db/entity';

export default class TimeFrameProcessor implements IProcessor<TimeFrame> {
  preProcess(name: string, object: TimeFrame): any {
    return object;
  }
}

It's logging before build but not after build. If I remove the preProcess method it resolves it.
Thanks!

Your Environment

Software Version(s)
typeorm-fixtures 1.9.0
Node v14.15.1
npm/Yarn 1.22.10
Operating System macOS

An in-range update of typeorm is breaking the build 🚨


🚨 Reminder! Less than one month left to migrate your repositories over to Snyk before Greenkeeper says goodbye on June 3rd! πŸ’œ πŸššπŸ’¨ πŸ’š

Find out how to migrate to Snyk at greenkeeper.io


The devDependency typeorm was updated from 0.2.24 to 0.2.25.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

typeorm is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[Feature request] relations in processor

I need an option to add relations in preProcessor dynamcily is this possible?

I'm using a table with an enum type field. For example "text" and "image".
Depending on the type I will add a relation for image or text and now I want to create fixtures for this.
Do you have an idea how I can handle this?

[Bug] Cannot load fixture

Your Environment

| Software | Version(s) |
| typeorm-fixtures-cli | 1.8.0 |
| Node | 14.5.0
| Yarn | 1.22.4
| Operating System | MacOs 10.15.7

I have the following relation:

  • A Team entity
  • A Source entity
  • A News entity, that has ManyToOne relationship with Team and Source
@ManyToOne(() => Source)
@JoinColumn({ name: "sourceId" })
source: Source;

@ManyToOne(() => Team)
@JoinColumn({ name: "teamId" })
team: Team;
  • A Comment entity, that has ManyToOne relationship with a News and a Comment
@ManyToOne(() => News)
@JoinColumn({ name: "newsId" })
news: News;

@ManyToOne(() => Comment)
@JoinColumn({ name: "parentId" })
parent: Comment | null;

I'm trying load some comments in database but, if all News have a Team then I get this error:

Screen Shot 2020-11-12 at 21 11 43

If I leave some News without a Team then the fixtures are loaded. But the Comments are related just with the News without a Team.

Using a console.log I found that the parse method in ReferenceParser is been called with the entities without any news. So, probably the library is trying load the comments when there is no news created.

reference own column in faker.helpers

How can I reference the title of the current iteration to slugify it with faker.helpers.slugify. I would expect something like so

entity: Post
items:
  post{1..10}:
    title: '{{lorem.words}}'
    slug: '{{helpers.slugify(@title)}}'
    body: '{{lorem.paragraphs}}'

two or more params for faker aren't supported

Seems that I can't use such definition:

entity: Ring
items:
  ring{0..10}:
    date: '{{date.past(5, '2018-01-01')}}'

because this method gets only one param which is:
5, '2018-01-01' concatenated string

An in-range update of @types/lodash is breaking the build 🚨

The devDependency @types/lodash was updated from 4.14.140 to 4.14.141.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

class-transformer decorators are ignored

Hello,

Thank you for this nice and handy library!

I have entity with decorators (I use DateTime type from luxon) and had problem because attribute of type DateTime cannot be created with new DateTime(). In luxon, you have to use DateTime.local() or DateTime.utc() to create new instances.

So I have write some decorators to get around this. However, my decorators are ignored when fixtures are transformed due to the parameter ignoreDecorators set to true in the call to plainToClassFromExist in Builder.js

if (typeof processorInstance.preProcess === 'function') {
                    data = yield processorInstance.preProcess(fixture.name, data);
                }
                entity = class_transformer_1.plainToClassFromExist(entity, data, { ignoreDecorators: false });
                yield callExecutors();
                /* istanbul ignore else */
                if (typeof processorInstance.postProcess === 'function') {
                    yield processorInstance.postProcess(fixture.name, entity);
                }

What are the reasons for setting ignoreDecorators to true? Could you make it optional?

Update joi dependency to @hapi/joi

During installation of typeorm-fixtures-cli following warning is generated:

warning typeorm-fixtures-cli > [email protected]: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

[Bug] Getting 'No repository for "Object" was found' when try to run fixtures

Your Environment

Software Version(s)
typeorm-fixtures 1.5.0
Node 12.16.3
npm/Yarn yarn 1.22.0
Operating System Alpine docker image

Hello!

I'm facing with a strange behavior using typeorm-fixtures with a NestJS application. When I try to run the fixtures, I'm getting this error:

Fail fixture loading: No repository for "Object" was found. Looks like this entity is not registered in current "default" connection?

After some investigation, I noticed that the error occurs in the line 112 of cli.ts file.

await connection.getRepository(entity.constructor.name).save(entity);

The problem seems to be that getRepository function is using the entity.constructor.name to get the repository for the entity. But at runtime, the constructor.name is equal to Object (I am right?). I think changing the line to:

await connection.getRepository(fixture.entity).save(entity)

At least I tested it locally and it worked

I'm getting the related error using this comand:

node_modules/.bin/fixtures ./test/fixtures --config ./ormconfig-e2e.ts --sync --require=ts-node/register --require=tsconfig-paths/register

Extra fields in Users entity

when I set data for Users entity I got extra fields in DB
My Users entity:

import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity()
export class Users {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ length: 100 })
  name: string;
}

I got:
ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅

With other entities all good, but not with this. What can it be?

Large datasets times scaling exponential

I tried to create several datasets for testing our application.
Starting with 100 base objects * 4 sub objects + a few thousand additional entities. Takes ~1 min
1000 * 4 + x thousand. Takes ~4min
10000 * 4 + x thousand. Crashes after 4+ hours.

Debug output

Connection to database...
Database is connected
Loading fixtureConfigs
Resolving fixtureConfigs

Node Profiling of first 5minutes.
image
Looks like most time is spend in the resolver at resolveDeepDependencies(item) {

Fail fixture loading: Maximum call stack size exceeded

Probably more of a question than a bug, but I guess we'll see...

I am trying to create fixtures for a table that has several ManyToOne relations.

UserGroup.ts

@Entity()
export default class UserGroup {
  @PrimaryGeneratedColumn()
  public id!: number;

  @ManyToOne(
    () => User,
    user => user.userGroups,
    { primary: true }
  ) // inverse "userGroups: UserGroup[]" is one-to-many in user
  @JoinColumn({ name: 'user_id' })
  user!: User;

  @ManyToOne(
    () => Group,
    group => group.userGroups,
    { primary: true }
  ) // inverse "userGroups: UserGroup[]" is one-to-many in group
  @JoinColumn({ name: 'group_id' })
  group!: Group;

  @Column({ name: 'status' })
  status: UserGroupStatus = UserGroupStatus.ACTIVE;
}

User.ts

@Entity()
export default class User {
...
  @OneToMany(
    _type => UserGroup,
    userGroup => userGroup.user,
    {
      eager: true
    }
  )
  userGroups!: UserGroup[];
}

and then the same for Group.

I am trying to populate the fixtures with:

User.yml

entity: User
items:
  user{1..2000}:
   ...
   userGroups: ["@userGroups*"]
entity: Group
items:
  group{1..2000}:
   ...
   userGroups: ["@userGroups*"]

UserGroup.yml

entity: UserGroup
items:
  userGroups{1..2000}:
    user_id: "@user($current)"
    group_id: "@group($current)"
    status: "{{random.number(4)}}"

But when I run the cli, I get the following error:

Fail fixture loading: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at Resolver.resolveDeepDependencies (/usr/app/server/node_modules/typeorm-fixtures-cli/dist/Resolver.js:118:31)
  ...

What am I doing wrong? I assume this is because of a circular reference between UserGroups and the User/Group entities, but I don't see how else I can create a relationship between the entities.

opencollective-postinstall: not found

I am trying to deploy my application into docker container and this package is breaking my deploy. I tried to configure docker container with DISABLE_OPENCOLLECTIVE=true and error persists.

imagen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.