danibram / mocker-data-generator

A simplified way to generate masive mock data based on a schema, you can use the awesome fake/random data generators like (FakerJs, ChanceJs, CasualJs and RandExpJs)
https://danibram.github.io/mocker-data-generator/
MIT License
426 stars 45 forks source link

Revert "read locale config for faker" #33

Closed danibram closed 6 years ago

danibram commented 6 years ago

Reverts danibram/mocker-data-generator#32

Sorry @sleicht but is not working for me, i just fixed doing this:


faker = require('faker/locale/en')

        if (cfg.locale) {
            re = /(^[a-z_A-Z]*)/   // en_US
            matches = re.exec(cfg.locale)

            if (matches && matches.length === 2) {
                faker = require('faker/locale/' + cfg.locale)
            }
        }

Im going to write in the docs, finish the tests and update the version, thank you anyway!

sleicht commented 6 years ago

strange, it looked as it does work on my side. But your version sure works. Thanks!

When will you publish the release to npmjs?

danibram commented 6 years ago

umm... yes its strange, but i cover by tests and if i use chinese languaje to easily recognize the changes it not work in my side, i published the new version so, i hope it works for everyone. Can you test if it works for you too? It seems that the tests went fine... Thanks!

sleicht commented 6 years ago

Yes, it does work also for me, thanks again.

sleicht commented 6 years ago

I get following warning:

` WARNING in ./node_modules/faker/locale/ReadMe.md Module parse failed: ./node_modules/faker/locale/ReadMe.md Unexpected character '#' (1:0) You may need an appropriate loader to handle this file type. # Read Me
The files in this directory have been auto-generated from the gulpfile.

@ ./node_modules/faker/locale ^.\/.*$ @ ./node_modules/mocker-data-generator/build/module/lib/Generator.js @ ./node_modules/mocker-data-generator/build/module/index.js `

Is this only on my side or should this be fixed somehow?

danibram commented 6 years ago

Umm I will try to reproduce that, I will let you know. It’s like something is trying to require a *.md file

adamkasztenny commented 5 years ago

I seem to be having this problem for 2.6.4 and 2.6.6:

WARNING in ./node_modules/faker/locale/ReadMe.md
Module parse failed: Unexpected character '#' (1:0)
You may need an appropriate loader to handle this file type.
| # Read Me
| 
| The files in this directory have been auto-generated from the `gulpfile`.
ℹ 「wdm」: Compiled with warnings.

I have an Angular 6 project, and it shows up when doing npm start.