devonfw / devon4ts Goto Github PK
View Code? Open in Web Editor NEWdevonfw TypeScript stack - create enterprise-grade business apps in Angular and NestJS safe and fast
License: Apache License 2.0
devonfw TypeScript stack - create enterprise-grade business apps in Angular and NestJS safe and fast
License: Apache License 2.0
Bug
When you start the application, it will remain active even if you change the content of the code. For development it can be useful that the application restarts every time you change the code, so you can add a different script for this purpose.
In nestjs template, this behaviour is present in the start and start:dev scripts.
start and start:dev scripts have the same behaviour: restart the application on code change.
Plase recover the original nestjs scripts:
"start": "ts-node -r tsconfig-paths/register src/main.ts",
"start:dev": "nodemon",
In step by step tutorial, step 4.IV and 5 aren't working due to outdated command lines:
@ApiModelPropertyOptional()
@ApiUseTag
enhancement
Low
As most projects using devon4node will be deployed in a dockerized environment, it would be nice to have an example Dockerfile for devon4node projects.
This doesn't need to be included in the current template, it could be available elsewhere in the repository.
As a < type of user >, I want < some goal > so that < some reason >
As a use, I want to create new application using devon4node using command devon4node new myApp .
As project name is mentioned using camel case project creation fails. I am able to create project with simple name such as employee.
Install devon4node CLI
Execute the command npm i -g @devon4node/cli
Create the new application
Execute the command devon4node new myApp
Question
Low
Currently, all models of the responses are inside a folder called view-model. In addition, they all have a name ending in -vm.ts.
In my opinion, as in this case we have no view and the model is used to transfer the data in the response, those models should be called data transfer objects (dto). Does it make sense? I think in devon4j they use this nomenclature.
My proposal is to change all references from view-model to dto (or to). As the title says, this is a discussion and maybe our main architect @ivanderk can show us the correct way.
CC @sjimenez77
Bug
Critical
When you start the application for a production environment (compiling the .ts files and using node instead of ts-node -> npm run start:prod) the application should start successfully.
The application shows the following error:
C:\Users\darrodri\Documents\Proyectos\devon4node\template (develop) ([email protected])
λ npm run start:prod
> [email protected] prestart:prod C:\Users\darrodri\Documents\Proyectos\devon4node\template
> rm -rf dist && tsc
> [email protected] start:prod C:\Users\darrodri\Documents\Proyectos\devon4node\template
> node dist/main.js
C:\Users\darrodri\Documents\Proyectos\devon4node\template\node_modules\config\lib\config.js:832
throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
^
Error: Cannot parse config file: 'C:\Users\darrodri\Documents\Proyectos\devon4node\template\config\default.ts': Error: Cannot find module 'ts-node'
at Config.util.parseFile (C:\Users\darrodri\Documents\Proyectos\devon4node\template\node_modules\config\lib\config.js:832:11)
at C:\Users\darrodri\Documents\Proyectos\devon4node\template\node_modules\config\lib\config.js:594:28
at Array.forEach (<anonymous>)
at C:\Users\darrodri\Documents\Proyectos\devon4node\template\node_modules\config\lib\config.js:590:14
at Array.forEach (<anonymous>)
at Config.util.loadFileConfigs (C:\Users\darrodri\Documents\Proyectos\devon4node\template\node_modules\config\lib\config.js:589:13)
at new Config (C:\Users\darrodri\Documents\Proyectos\devon4node\template\node_modules\config\lib\config.js:136:27)
at Object.<anonymous> (C:\Users\darrodri\Documents\Proyectos\devon4node\template\node_modules\config\lib\config.js:1637:31)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start:prod: `node dist/main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\darrodri\AppData\Roaming\npm-cache\_logs\2018-11-20T16_39_18_425Z-debug.log
Execute npm run start:prod
in the template folder.
As you can see in the error, this is related to the config files. We never compile it so node can't run it.
Currently, we have a getTodos
service implemented here which returns the complete list of Todos
elements. Unfortunately, there is no service implemented for searching Todo
items by some criteria.
I don't think it would be hard to implement this and it would be very interesting for our current devon4ng client application, which contains a search by criteria.
Enhancement
Critical
Having to wait to pass the tests every time you commit, even if you only change the README.md, is a waste of time. Besides, nothing prevents the developer from deactivating this in his local environment, so in my opinion it's useless. There are other more effective techniques to check that all commits/push pass the tests.
So, please disable husky by default.
Enhancement
Medium
Enable the strict mode in tsconfig.json file. I know that by activating this the creation of entities and data becomes much more complicated, as strict enables strictPropertyInitialization, but nothing prevents us from activating the other 5 properties that strict enables. These are:
Bug
High
As swagger should only be used for development purposes, it should only be available in development environments and NEVER in a production environment.
Swagger is available for all environments.
The only thing to do here is to change line 13 of the main.ts file from:
if (hostDomain) {
to:
if (AppModule.isDev) {
tsconfig.json should include custom properties
As a developer, I want to be able to introduce an application name in camel case so that I will create a new application with that name
When you introduce a name in camel case it throws an error.
latest
The rule '@typescript-eslint/interface-name-prefix': 'off', defined in .eslintrc.js should enforce an interface naming rule.
This rule has been removed in @typescript-eslint latest versions, causing the linter to not work as expected. It invalidates all JS files instead.
Use latest recommended rule definition:
_yargs_completions() does not work well or at all.
Need for a more in deep explanation on how to configure it.
Hello,
I was just looking the TODO example when I realised that in the role.guard.ts there is an undefined check of a variable after being accessed in this line.
P.D.: I would do a PR but I don't have time right now sorry :(
Enhancement
High
The configuration of the database is inside the app.module.ts file. To be more flexible this configuration should be in a separate file. For example: using the ormconfig. Typeorm offers this behavior using the ormconfig.json file.
As a developer, I want to be able to log-in using as username waiter
and password waiter
so that we have an standard way to access every application of devonfw.
In MyThaiStar and CobiGen generated front-ends we are able to log-in using waiter
and password waiter
. I would like to have the same for devon4node :)
As it may confuse some people, I would like to see an example about how to execute a database command so that it's clear how it's done.
As a developer using npm I want to be able to install schematics.
When trying to use the convict schematic, package installation fails when npm is configured as package manager.
@devon4node/schematics
nest g -c @devon4node/schematics convict
yarn is hard-coded in tree-utils in line 90
@devon4node/schematics: 5.0.1
@nestjs/cli: 9.0.0
node: 18.16.12
I am convinced that a Nx workspace monorepo is definitely much better than lerna for many reasons.
Anyhow, here there is an interesting article (from Nrwl) that points out the benefits https://blog.nrwl.io/migrating-from-lerna-to-nx-better-dev-ergonomics-much-faster-build-times-da76ff14ccbb
Enhancement
Medium
Add in the template the security described in the official nestjs documentation..
If some part, like CRSF, we consider not necessary by default, we can leave an example in another part of the repository called, for example, snippets.
In my opionion helmet and cors must be enabled by default (currently only cors is enabled).
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.