Skip to content

Commit 079c495

Browse files
authored
Rename webpack to webapp & Fix DTO (jhipster#725)
* Rename webpack to webapp * Rename webpack to webapp in doc * Fix DTO * Use entityConfig rather than context
1 parent 575a785 commit 079c495

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

generators/client/templates/blazor/src/Project.Client/wwwroot/content/scss/vendor.scss.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* after changing this file run 'npm run webpack:build' */
1+
/* after changing this file run 'npm run webapp:build' */
22

33
/***************************
44
put Sass variables here:

generators/client/templates/blazor/src/Project.Client/wwwroot/index.html.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<li>
3737
You started the application from an IDE and you didn't run <code style="color:red">npm start</code>
3838
or
39-
<code style="color:red">npm run webpack:build</code>.
39+
<code style="color:red">npm run webapp:build</code>.
4040
</li>
4141
<li>
4242
You had a network error while running <code style="color:red">npm install</code>. If you are behind
@@ -61,7 +61,7 @@
6161
<ol>
6262
<li>Install npm dependencies with the command <code style="color:red">npm install</code></li>
6363
<li>
64-
Build the client with the command <code style="color:red">npm run webpack:build</code> or <code style="color:red">npm start</code>
64+
Build the client with the command <code style="color:red">npm run webapp:build</code> or <code style="color:red">npm start</code>
6565
</li>
6666
<li>Start the server with <code style="color:red">./mvnw</code> or using your IDE</li>
6767
</ol>

generators/entity-client/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ module.exports = class extends EntityClientGenerator {
7575
rebuildClient() {
7676
if (!this.options.skipInstall && !this.skipClient && this.clientFramework !== BLAZOR && this.clientFramework !== XAMARIN) {
7777
const done = this.async();
78-
this.log(`\n${chalk.bold.green('Running `webpack:build` to update client app\n')}`);
79-
this.spawnCommand('npm', ['--prefix', `${constants.SERVER_SRC_DIR}${this.mainClientDir}`, 'run', 'webpack:build']).on(
78+
this.log(`\n${chalk.bold.green('Running `webapp:build` to update client app\n')}`);
79+
this.spawnCommand('npm', ['--prefix', `${constants.SERVER_SRC_DIR}${this.mainClientDir}`, 'run', 'webapp:build']).on(
8080
'close',
8181
() => {
8282
done();

generators/entity/prompts.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ function askForFieldsToRemove() {
190190
this.prompt(prompts).then(props => {
191191
if (props.confirmRemove) {
192192
this.log(chalk.red(`\nRemoving fields: ${props.fieldsToRemove}\n`));
193-
for (let i = context.fields.length - 1; i >= 0; i -= 1) {
194-
const field = context.fields[i];
193+
for (let i = this.entityConfig.fields.length - 1; i >= 0; i -= 1) {
194+
const field = this.entityConfig.fields[i];
195195
if (props.fieldsToRemove.filter(val => val === field.fieldName).length > 0) {
196-
context.fields.splice(i, 1);
196+
this.entityConfig.fields.splice(i, 1);
197197
}
198198
}
199199
}
@@ -246,10 +246,10 @@ function askForRelationsToRemove() {
246246
this.prompt(prompts).then(props => {
247247
if (props.confirmRemove) {
248248
this.log(chalk.red(`\nRemoving relationships: ${props.relsToRemove}\n`));
249-
for (let i = context.relationships.length - 1; i >= 0; i -= 1) {
250-
const rel = context.relationships[i];
249+
for (let i = this.entityConfig.relationships.length - 1; i >= 0; i -= 1) {
250+
const rel = this.entityConfig.relationships[i];
251251
if (props.relsToRemove.filter(val => val === `${rel.relationshipName}:${rel.relationshipType}`).length > 0) {
252-
context.relationships.splice(i, 1);
252+
this.entityConfig.relationships.splice(i, 1);
253253
}
254254
}
255255
}
@@ -265,8 +265,8 @@ function askForTableName() {
265265
const skipCheckLengthOfIdentifier = context.skipCheckLengthOfIdentifier;
266266
if (
267267
skipCheckLengthOfIdentifier ||
268-
!context.relationships ||
269-
context.relationships.length === 0 ||
268+
!this.entityConfig.relationships ||
269+
this.entityConfig.relationships.length === 0 ||
270270
entityTableName.length <= 30
271271
/* (prodDatabaseType === 'oracle' && entityTableName.length > 14) || */
272272
) {
@@ -308,7 +308,7 @@ function askForTableName() {
308308
/* function askForFiltering() {
309309
const context = this.context;
310310
// don't prompt if server is skipped, or the backend is not sql, or no service requested
311-
if (context.useConfigurationFile || context.skipServer || context.databaseType !== 'sql' || context.service === 'no') {
311+
if (context.useConfigurationFile || context.skipServer || context.databaseType !== 'sql' || this.entityConfig.service === 'no') {
312312
return;
313313
}
314314
const done = this.async();
@@ -339,7 +339,7 @@ function askForTableName() {
339339
function askForDTO() {
340340
const context = this.context;
341341
// don't prompt if data is imported from a file or server is skipped or if no service layer
342-
if (context.useConfigurationFile || context.skipServer || context.service === 'no') {
342+
if (context.useConfigurationFile || context.skipServer || this.entityConfig.service === 'no') {
343343
context.dto = context.dto || 'no';
344344
return;
345345
}
@@ -363,7 +363,7 @@ function askForDTO() {
363363
},
364364
];
365365
this.prompt(prompts).then(props => {
366-
context.dto = props.dto;
366+
this.entityConfig.dto = props.dto;
367367
done();
368368
});
369369
}
@@ -394,7 +394,7 @@ function askForService() {
394394
},
395395
];
396396
this.prompt(prompts).then(props => {
397-
context.service = props.service;
397+
this.entityConfig.service = props.service;
398398
done();
399399
});
400400
}
@@ -432,7 +432,7 @@ function askForPagination() {
432432
},
433433
];
434434
this.prompt(prompts).then(props => {
435-
context.pagination = props.pagination;
435+
this.entityConfig.pagination = props.pagination;
436436
this.log(chalk.green('\nEverything is configured, generating the entity...\n'));
437437
done();
438438
});

0 commit comments

Comments
 (0)