Closed dwarakaprasad closed 6 months ago
I'd say that is related to linking the generator-jhipster dependency instead of installing. Blueprint lookup uses relative path: https://github.com/jhipster/generator-jhipster/blob/595adc94fc657050a3a69d35940f019987ce5644/testing/helpers.ts#L176
So lookup won’t find the generator. Not stand alone generators have lookup done at runtime too, so they work.
You can try installing from git:
npm install jhipster/generator-jhipster
You can try installing from git:
npm install jhipster/generator-jhipster
Doing this is causing,
FAIL generators/license/generator.spec.js [ generators/license/generator.spec.js ]
Error: Cannot find package 'fs-extra' imported from /home/dwarka/develop/jhipster/testing/generator-jhipster-stand/node_modules/generator-jhipster/dist/testing/support/check-enforcements.js
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_MODULE_NOT_FOUND' }
I think, for this issue we will have to move both fs-extra & esmocha from devDependencies to dependencies. Adding these 2 dependencies makes the original issue go away (thank you :-)). Do you want me to create a separate issue for this change or can I push it as part of this issue.
I think, for this issue we will have to move both fs-extra & esmocha from devDependencies to dependencies.
Blueprints uses vitest so we should not export mocha. https://github.com/jhipster/generator-jhipster/blob/main/testing/support/check-enforcements.ts should be moved back to test/support and not exported.
Blueprints uses vitest so we should not export mocha.
Yeah that's right, it was my bad. I will push it back to test/support and raise a pr.
No problem, the original error could be fixed by passing the blueprint folder to lookup. Since the error only happens with linked generator-jhipster not sure we should do something about this.
Overview of the issue
A stand alone blueprint throws the following error during unit testing,
The above error occurs when using generator-jhipster main. Everything seems ok with release 8.1.0 version.
Motivation for or Use Case
It should be possible to create and successfully run a stand alone blueprint.
Reproduce the error
Create a blueprint using the attached .yo-rc.json
Related issues
None.
Suggest a Fix
Triage still in progress.
@mshima this part is returning undefined, which was changed as part of this pr. Prior to this change, the store.meta seem to have loaded jhipster-blueprint: & jhipster: name spaces which was why the blueprint was discover-able (based on my limited knowledge). Currently I only see that jhipster:** name space only being loaded and hence the findMeta method return undefined.
Can you please provide some insight and I can try to fix this... Thanks...
JHipster Version(s)
main branch
JHipster configuration
.yo-rc.json file
Environment and Tools
openjdk version "17.0.8" 2023-07-18 OpenJDK Runtime Environment Temurin-17.0.8+7 (build 17.0.8+7) OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (build 17.0.8+7, mixed mode, sharing)
git version 2.34.1
node: v20.11.1 npm: 10.2.4
Docker version 25.0.3, build 4debf41
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System