Skip to content

Commit 72cff87

Browse files
committed
Fix documentation code generation
1 parent 63103ad commit 72cff87

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

documentation/guides-code-generation.asciidoc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ Those tools are:
2424
- link:https://www.npmjs.com/package/@devon4node/schematics[devon4node schematics through Nest CLI]
2525
- link:https://github.com/devonfw/cobigen[CobiGen]
2626

27-
// == Differences between tools
28-
29-
// As you may have noticed, we have two tools to generate code, instead of having just one. What is the reason? The reason is that each tool starts from a different input. devon4node CLI receives user input, while cobigen receives code already exists and generates the rest accordingly. So, in order to increase the productivity, we can combine the use of both.
30-
3127
== Nest CLI and Devon4node schematics
3228

3329
We are going to use the Nest CLI to generate code of our application, you can know more about NodeJs CLI in the official link:https://docs.nestjs.com/cli/overview:[documentation].
@@ -36,11 +32,12 @@ We are going to use the Nest CLI to generate code of our application, you can kn
3632

3733
First of all, you need to install Nest CLI
3834

39-
Execute the command `yarn global add @nestjs/cli`
35+
Execute the command `yarn global add @nestjs/cli`.
36+
You can also use npm: `npm install -g @nestjs/cli`
4037

4138
And then Devon4node schematics globally with the following command:
4239

43-
`yarn global add @devon4node/schematics`
40+
`yarn global add @devon4node/schematics` or `npm install -g @devon4node/schematics`
4441

4542
[NOTE]
4643
====
@@ -127,13 +124,14 @@ Execute `nest g -c @devon4node/schematics security`
127124
=== Generate database migrations
128125

129126
. Generate database migrations
130-
.. In order to create migration scripts with typeorm, you need to install ts-node: `yarn global add ts-node`
127+
.. In order to create migration scripts with typeorm, you need to install ts-node: `yarn global add ts-node` or `npm i -g ts-node`
131128
.. Generate the tables creation migration: `yarn run typeorm migration:generate -n CreateTables`
132129
+
130+
image::images/insert-data.PNG[]
133131
It will connect to the database, read all entities and then it will generate a migration file with all sql queries need to transform the current status of the database to the status defined by the entities. If the database is empty, it will generate all sql queries need to create all tables defined in the entities. You can find a example in the todo example
134132

135133
As typeorm is the tool used for DB. You can check official documentation for more information.
136-
See link::[typeorm CLI documentation].
134+
See link::https://typeorm.io/#/using-cli[typeorm CLI documentation].
137135

138136
== CobiGen
139137

29.6 KB
Loading

0 commit comments

Comments
 (0)