RobinCK
Repos
21
Followers
58
Following
1

:boom: Vue plugin for work with local storage, session storage and memory storage from Vue context 🇺🇦

534
44

:camera: Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. 🇺🇦

435
81

:whale: VueJS popover component based popper.js 🇺🇦

429
98

A Vue.js plugin for lazyload your Image or Component in your application.

7790
857

:pill: Fixtures loader for typeorm 🇺🇦

436
44

A low-level toolkit to create floating elements. Tooltips, popovers, dropdowns, and more

24209
1379

Events

closed issue
Update: popper.js from v1 to v2
Created at 2 months ago
issue comment
Update: popper.js from v1 to v2

Everyone can help and create PR

Created at 2 months ago
[Bug]

| Software | Version(s) | | ---------------- | ---------- | | typeorm-fixtures | 3.0.0 | Node | v16.14.2 | npm/Yarn | yarn 1.22.15 | Operating System | Windows 11

The lib is unable to find fixture files inside a folder in Windows beacuse glob.sync seems not to work properly in glob 8

Workaround using yarn resolutions:

  "resolutions": {
    "typeorm-fixtures-cli/**/glob": "7.2.3"
  }
Created at 2 months ago
issue comment
[Bug]

fixed in 3.0.2

Created at 2 months ago
issue comment
ci(github actions): configure build ci for multiplatform

@kkent030315 thank you

Created at 2 months ago

chore(release): 3.0.2 :tada:

Created at 2 months ago

configure ci for multi-platform

making sure it works

configure lf eol and autocrlf in windows

remove temporally debug code

recover whitespace in the bracket

Merge pull request #205 from kkent030315/develop

ci(github actions): configure build ci for multiplatform

Created at 2 months ago
pull request closed
ci(github actions): configure build ci for multiplatform

Linking Issues/PRs

  • #203
  • #204

This improves reliability by making it to be able to catch platform-specific bugs.

In the test CI of this changes in my fork repo, it clearly reproduces #203. https://github.com/kkent030315/typeorm-fixtures/actions/runs/3368028319/jobs/5586113197

Created at 2 months ago
[Bug] glob is broken in Windows and cannot iterate by folder

Problem

Hey, I am having problems loading fixtures from a folder. The folder ./graphql/fixtures/ actually contains .yml but never be loaded in both CLI & Programmatically loading fixtures

📦fixtures
 ┗ 📜Customer.yml
> npm run fixtures load ./graphql/fixtures/ --dataSource=./dataSource.ts --sync --require=ts-node/register --require=tsconfig-paths/register    

Connection to database...
query: SELECT * FROM current_schema()
query: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
query: SELECT version();
Loading fixtureConfigs
Resolving fixtureConfigs
Progress [██████████████████████████████████████████████████] 100% | ET 
Database disconnect
loadFixtures('./graphql/fixtures') // never loads any files.

But specifying the exact file just like below works. as well on the Programmatically loading fixtures.

> npm run fixtures load ./graphql/fixtures/Customer.yml --dataSource=./dataSource.ts --sync --require=ts-node/register --require=tsconfig-paths/register
loadFixtures('./graphql/fixtures/Customer.yml') // loads only "Customer.yml" file as expected.

So then I cloned this repo and tried to execute tests:

gh repo clone RobinCK/typeorm-fixtures
npm i
npm run test

Then specific tests regarding Loader, Resolver will be failed.

> typeorm-fixtures-cli@3.0.1 test
> nyc mocha "test/**/*.ts"



  Builder
    ✔ should be build entity
    ✔ should be build and transformed entity
    ✔ should be processed entity
    ✔ should be call method
    ✔ should be processor not found
    ✔ should be invalid __call parameter
    ✔ should be resolved entity field as promised

  Loader
    1) should be loaded data from folder
    ✔ should be loaded data from file
    ✔ should be fail load
    ✔ should be no such file
    2) should be invalid fixture config

  Parser
    ✔ should be parsed object
    ✔ should be parsed array
    ✔ should be parsed deep object
    ✔ should be parsed deep array
    ✔ should parse `null` as `null`

  EJS parser
    ✔ should be support
    ✔ should be not support
    ✔ should be parsed

  Faker parser
    ✔ should be support
    ✔ should be not support
    ✔ should be number
    ✔ should be boolean
    ✔ should be string
    ✔ should be translated string

  Parameter parser
    ✔ should be support
    ✔ should be not support
    ✔ should be parsed
    ✔ should be not parsed
    ✔ should be taken from process.env
    ✔ should throw on unknown env variable
    ✔ should prefer explicit parameters to env variables

  Parameter parser
    ✔ should be support
    ✔ should be not support
    ✔ should be resolver
    ✔ should be resolver mask
    ✔ should be not resolver

  Resolver
    3) should be resolved fixtures
    ✔ should be resolved range fixtures
    ✔ should be resolved range reference
    ✔ should be resolved range fixtures
    ✔ should be resolved deep reference
    ✔ should be resolved mask reference
    ✔ should be resolved current
    ✔ should be resolved calculated current
    ✔ should be fail resolved current
    ✔ should be reference not found
    ✔ should be resolved with equal dependencies for wildcard

  Fixtures Iterator
    ✔ should be sort and iterate fixtures


  47 passing (67ms)
  3 failing

  1) Loader
       should be loaded data from folder:

      AssertionError: expected [] to have a length of 2 but got +0
      + expected - actual

      -0
      +2

      at Context.<anonymous> (test\unit\Loader.test.ts:18:28)
      at processImmediate (node:internal/timers:466:21)

  2) Loader
       should be invalid fixture config:
     AssertionError: expected [Function] to throw an error
      at Context.<anonymous> (test\unit\Loader.test.ts:94:92)
      at processImmediate (node:internal/timers:466:21)

  3) Resolver
       should be resolved fixtures:

      AssertionError: expected [] to deeply equal [ { parameters: {}, …(4) }, …(1) ]
      + expected - actual

      -[]
      +[
      +  {
      +    "data": {
      +      "email": "{{internet.email}}"
      +      "firstName": "{{name.firstName}}"
      +      "lastName": "{{name.lastName}}"
      +    }
      +    "dependencies": []
      +    "entity": "User"
      +    "name": "user1"
      +    "parameters": {}
      +  }
      +  {
      +    "data": {
      +      "description": "{{lorem.paragraphs}}"
      +      "title": "{{name.title}}"
      +      "user": "@user1"
      +    }
      +    "dependencies": [
      +      "user1"
      +    ]
      +    "entity": "Post"
      +    "name": "post1"
      +    "parameters": {}
      +  }
      +]

      at Context.<anonymous> (test\unit\Resolver.test.ts:19:32)
      at processImmediate (node:internal/timers:466:21)

Cause

https://github.com/RobinCK/typeorm-fixtures/blob/86d1395daa1102d1bf210dfc4aa54c3190ea570d/src/Loader.ts#L22-L36

files was empty array [] so this line of code is cause:

https://github.com/RobinCK/typeorm-fixtures/blob/86d1395daa1102d1bf210dfc4aa54c3190ea570d/src/Loader.ts#L33

So then, I thought something is wrong in glob and downgraded to "glob": "^7.x", it works. According to the glob changelog in 8.x

8.0 Only support node v12 and higher \ is now only used as an escape character, and never as a path separator in glob patterns, so that Windows users have a way to match against filenames containing literal glob pattern characters. Glob pattern paths must use forward-slashes as path separators, since \ is an escape character to match literal glob pattern characters. (8.0.2) cwd and root will always be automatically coerced to use / as path separators on Windows, as they cannot contain glob patterns anyway, and are often supplied by path.resolve() and other methods that will use \ path separators by default.

  • This seems like Windows is the problem at this time, according to https://github.com/isaacs/node-glob/issues/480 and its explained by https://github.com/isaacs/node-glob/issues/480#issuecomment-1152960825

Then I made some changes, to avoid \ path separator and use / instead:

files = glob.sync(
                path
                    .resolve(path.join(fixturesPath, `*.{${extensions}}`))
                    .split(path.sep)
                    .join('/'),
            );

The all tests passed and fixed. I'll make a PR for this issue, so I appreciate if you take a look to it. :)

Your Environment

| Software | Version(s) | | ---------------- | ---------- | | typeorm-fixtures | 3.0.1 | | Node | v16.14.2 | | npm/Yarn | npm | | Operating System | Windows 11 |

Created at 2 months ago
pull request closed
fix: glob path separator must use '/' on Windows
  • Issue #203

Path passed to glob.sync must explicitly use / instead of \ in Windows environment due to glob 7.x -> 8.x changes as described in the issue.

Created at 2 months ago

fix: glob path separator must use '/' on Windows (#203)

path passed to glob.sync must explicitly use '/' instead of '' due to glob 7.x -> 8.x changes.

FIX #203

Merge pull request #204 from kkent030315/fixglob

fix: glob path separator must use '/' on Windows

Created at 2 months ago