jhipster / generator-jhipster-nodejs Goto Github PK
View Code? Open in Web Editor NEWA NodeJS blueprint that creates the backend using NestJS
Home Page: https://www.npmjs.com/package/generator-jhipster-nodejs
License: Apache License 2.0
A NodeJS blueprint that creates the backend using NestJS
Home Page: https://www.npmjs.com/package/generator-jhipster-nodejs
License: Apache License 2.0
If we choose the internationalization answer, the default html home page for NHipster is translated. So it is needed to override also the languages json files for NHipster in Angular client.
Now there is a server/src/initial-data.load.ts that inserts initial user data (for security) on the server startup. For every reload, 'cause the id primary keys are autogenerated, it reinsert the same data. Find a way to avoid that.
The entity test is fixed and works, but when I run the entity command from a previous project generated:
jhipster entity foo --blueprint nodejs
It breaks with error:
Error: The entity cannot be generated as the application does not have a database configured! at Environment.error (C:\Users\amanganiello\Desktop\jhipster-projects\generator-jhipster\node_modules\yeoman-environment\lib\environment.js:176:40)
It's strange because the yo-rc.json file project has defined the databaseType with a defined value:
"databaseType": "sql", "devDatabaseType": "h2Memory", "prodDatabaseType": "mysql",
The exception is run from jhipster when databaseType has no value
Describe the bug
When generating an application (?), the original server files are generated (.java, dockers, etc.) while they shouldn't.
According to the roadmap, there should be a huge clean up of files and start from scratch.
To Reproduce
Generate a new node application.
Expected behavior
No src folder should be generated there as only "dummy.txt" should be generated.
Desktop (please complete the following information):
It can be used for keycloack oauth2 integration
Bering fan of working with JavaScript/TS environment, I would like to see the generation of code purely in JavaScript/TypeScript respectively.
I see still we use Maven build system to compile and package expressJs code.
Describe the bug
related to #56 in the comment
To Reproduce
jhipster import-jdl <my-file.jh> --blueprints nodejs
Expected behavior
Correct generation without error
Additional context
The error is that missing in utils the buildEnumInfo function.
Describe the bug
Already run the command "npm install -g generator-jhipster-nodejs" but got error when run "jhipster --blueprint nodejs"
throw er; // Unhandled 'error' event
^
Error: The ←[33mgenerator-jhipster-nodejs←[39m blueprint provided is not installed. Please install it using command ←[33mnpm i -g generator-jhipster-nodejs←[39m.
at Environment.error
Hi
I would like to contribute code for TypeORM mappings for the server-entity generator. I will be starting right now unless you decide a different technology is a better fit.
Refactoring DTS:
-1. Delete entity generator in blueprint
-2. server templates modify:
-3. entity-server modify: common, domain, repository, service and controller
-4. rename folder spring-controller and spring-service without spring but nestjs
Generator installation fails with Not Found - GET https://registry.npmjs.org/generator-jhipster-nodejs - Not found
npm install -g generator-jhipster-nodejs
5.8.2
i added my jdl ImageBlog but it tells me that image Is not Support mysql database
could you please fix that error or is their any other way to use image field ?
If we choose the internationalization answer, the default html home page for NHipster is translated. So it is needed to override also the languages json files for NHipster in React client.
With the new structure, the server generator prompts the standard java jhipster question that now are not all supported. So it would be good to override the prompt with only the right questions.
Hi @deepu105,
We are quite near to release the first version of this blueprint. Could you add a section in the offical blueprint jhipster page ?
There would be good in order to give attention and pleasure to the all development community. Thanks a lot in advance.
Core admin use-rmanagement api implementation for NestJS
running Travis build
https://travis-ci.org/hadirsa/generator-jhipster-nodejs/builds/546741512
I get the error below running the build in Travis:
1) Subgenerator server of nodejs JHipster blueprint
Sample test
"before all" hook:
Uncaught TypeError: Cannot read property 'endsWith' of undefined
at module.exports.getAngularAppName (node_modules/generator-jhipster/generators/generator-base.js:1586:56)
at module.exports.configureGlobal (node_modules/generator-jhipster/generators/server/index.js:369:44)
at Object.<anonymous> (node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:424:27)
at /home/travis/build/hadirsa/generator-jhipster-nodejs/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /home/travis/build/hadirsa/generator-jhipster-nodejs/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:425:13)
is this bug or something? @amanganiello90
If you re run generation, only for the server generator it ignores the yo-rc.json, reasking the prompt questions. I have fixed that adding in initialitation phase:
if(this.applicationType){
this.log(
chalk.green(
"This is an existing project, using the configuration from your .yo-rc.json file \n"+
"to re-generate the project...\n"
)
);
// how get serverPort and mongoDatabaseProd....
this.existingProject = true;
}
But now there is the problem that the generators does not read the answers from the yo-rc.json for the server generation (serverPort and mongoDatabaseProd variables). I have tried with the following but it doesn't retrieve parameter:
const configuration = this.getAllJhipsterConfig(this, true);
const mongoDatabaseProd = configuration.get("mongoDatabaseProd")
Lets not use a separate CLI here. Blueprints should use jhipster cli and specify the blueprint name so that when we get multiple blueprint working we can interop without issues. Also it avoids fragmentation
As the blueprint generates for the microservice or monolithic app new structure, we have to override the standard jhipster README with a new that explains the instruction to run the app:
For dev: mvnw package -Pdev
And for prod:
For dev: mvnw package -Pprod
@hadirsa would you resolve this issue? Thanks
A way to include mongodb in prod with db migration schema
For the application type that is not monolithic with client, has already the maven command to run the entire project. Now it's necessary to include the client build in the server running (and build) exposed by NestJS
Delete yarn for server side from pom.xml (allow only npm)
After adding the oauth2-redirect.html template, in the swagger login page there is an error for pkce in okta with correct clientId, clientSecret and scopes.
We need to add new jest tests for entity, add new field types optimizing templates
Hi all,
as @gmarziou and @mraible have indicated, we can replace the maven tool with a simple node script to manage running and building profiles (dev or prod), and in future other profiles (as example CI/CD and so on). In a standard jhipster app, only for a monolithic app with the client there is the maven frontend plugin to install and manage node/npm version, but in this blueprint, that is mandatory to have nodejs also for backend, we can avoid to use it, and add only a constraint of a nodejs minimum version, according the client and server requirement. This mean reason is explainable, as said @mraible here, the target is a common nodejs developer. Do you agree? thanks for the attention.
We need to write and read password on db with encryption way. See this microservice as reference.
Related to jhipster issue with PR, this can optimize and DELETE ALL JAVA REFERENCES in the prompts. Now i18n is not provided, only English language, so it's the reason that we have to delete that question.
For the question in #50, we need to test prod connection db and give doc to run it in prod for typeorm url instance changing (modify server README)
For this release, it is needed to update documentation, update new jhipster version, log in prompt, gif, and so on.
The features that will be released (indicated in the CHANGELOG.md) are:
As explained @ameinabdi here, we have to test compatibility with NHipster without providing i18n for react client.
As @mraible asked me, we would provide support to choose instead of simple jwt authentication, the oauth2 protocol in the related question. Passport can already allow this configuration with the correct strategy class. Please refer to oauth2 server or nestJS oauth2 app
Describe the bug
Following the installation steps (and those for jhipster). I am getting this error:
sh: rimraf: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! [email protected] cleanup: `rimraf target/classes/static/ target/classes/aot`
npm ERR! spawn ENOENT
npm ERR!
To Reproduce
Steps to reproduce the behavior:
git clone [email protected]:jhipster/generator-jhipster-nodejs.git
cd $_
npm i
npm link .
npm i -g yo
npm i -g generator-jhipster
take /tmp/demo-app
jhipster --blueprint nodejs
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Either jhipster or this nestjs blueprint assume that the rimraf
package is installed globally. However, in the nodejs/javascript community we dont recommend installing such packages globally (for security reasons).
A possible fix for this issue is to install the rimraf
package as a dev dependency locally to the project and call the binary from the local ./node_modules
.
Hi all wonderful community, @jdubois, @deepu105 and @pascalgrimaud,
as discussed in the private and public chats, I'm ready to release the first version of the generator with the tested and last features developed by me, indicated in the CHANGELOG.
Thanks all for the attention and the interest :) .
Hi, first of, you guys are doing an amazing job!
Is your feature request related to a problem? Please describe.
TSlint is to be deprecated (or already is) in favor of ESLint. And this generator already seems to use ESLint.
Describe the solution you'd like
Using ESLint instead of TSLint, and that includes changes in (not exhaustive I think):
Describe alternatives you've considered
Maybe waiting a bit, if all the relevant rules are not yet implemented in ESLint (but I think everything's in order), this may need checking.
To help in development, could you please share road map link?
@amanganiello90
As explained in the title, we have to provide mongodb entity generation only for prod running, without go in conflict with sqlite dev database.
In addition to the static tests, we need to add and execute ntegration test (of code generated and up running) in the travis build
I have found that the package.json with the local jhipster dependency is not generated in the case of no client. We need to provide it in order to avoid error install hook. Besides it can be useful for the pom.xml changing in node script. Check package.json avoiding open api and adding check node. Refer also to #44
As the title, in case of enum fields entity generation, it must be valid only for prod database running.
Describe the bug
When there is a prompt for the production database and postgresql is chosen this populates orm.config.ts with the prod database type of postgresql at line 28. This value should be postgres as per the value in PostgresConnectioOptions.d.ts
To Reproduce
Steps to reproduce the behavior:
jhipster --blueprint nodejs
choose monolithic
choose postgresql for production database
Expected behavior
value in orm.config.ts should be postgres.
Screenshots
not required
Desktop (please complete the following information):
IOS
Chrome
current as per 26/10/19
Smartphone (please complete the following information):
NA
Additional context
Supplied as required
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.