Skip to content

Commit e956c21

Browse files
authored
Upgrade to jhipster v7.1.0 (jhipster#798)
* Upgrade to jhipster v7.1.0 * set diag level * Try add env * Update node version * Try add env * Update csproj * Fix fail base on output * fix some bugs * fix lint * update node
1 parent 48eb277 commit e956c21

File tree

31 files changed

+785
-13480
lines changed

31 files changed

+785
-13480
lines changed

.github/workflows/generator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
1212
strategy:
1313
matrix:
14-
node_version: [14.16.0]
14+
node_version: [14.17.0]
1515

1616
steps:
1717
- uses: actions/checkout@v2

.github/workflows/test-integration-jwt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
node_version: [14.16.0]
12+
node_version: [14.17.0]
1313
os: [ubuntu-latest]
1414
app-type:
1515
- jwt-with-angular-app

.github/workflows/test-integration-microservice.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
node_version: [14.16.0]
12+
node_version: [14.17.0]
1313
os: [ubuntu-latest]
1414
app-type:
1515
- microservice-app

.github/workflows/test-integration-oauth.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
node_version: [14.16.0]
12+
node_version: [14.17.0]
1313
os: [ubuntu-latest]
1414
app-type:
1515
- oauth-with-angular-app

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN \
1515
sudo \
1616
git && \
1717
# install node.js
18-
wget https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.gz -O /tmp/node.tar.gz && \
18+
wget https://nodejs.org/dist/v14.17.3/node-v14.17.3-linux-x64.tar.gz -O /tmp/node.tar.gz && \
1919
tar -C /usr/local --strip-components 1 -xzf /tmp/node.tar.gz && \
2020
# upgrade npm
2121
npm install -g npm && \

generators/client/files-common.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const { ANGULAR, REACT, VUE } = baseConstants.SUPPORTED_CLIENT_FRAMEWORKS;
2525
const SERVER_SRC_DIR = constants.SERVER_SRC_DIR;
2626

2727
function updateWebpackCommonJs() {
28-
if(this.clientFramework === VUE || this.clientFramework === REACT ) {
28+
if (this.clientFramework === VUE || this.clientFramework === REACT) {
2929
this.replaceContent(
3030
`${SERVER_SRC_DIR}${this.mainClientDir}/webpack/webpack.common.js`,
3131
`${SERVER_SRC_DIR}${this.mainClientDir}/`,
@@ -54,7 +54,7 @@ function updateWebpackCommonJs() {
5454
}
5555

5656
function updateWebpackDevJs() {
57-
if(this.clientFramework === VUE || this.clientFramework === REACT ) {
57+
if (this.clientFramework === VUE || this.clientFramework === REACT) {
5858
this.replaceContent(
5959
`${SERVER_SRC_DIR}${this.mainClientDir}/webpack/webpack.dev.js`,
6060
`${SERVER_SRC_DIR}${this.mainClientDir}/`,
@@ -95,7 +95,7 @@ function updateWebpackDevJs() {
9595
}
9696

9797
function updateWebpackProdJs() {
98-
if(this.clientFramework === VUE || this.clientFramework === REACT ) {
98+
if (this.clientFramework === VUE || this.clientFramework === REACT) {
9999
this.replaceContent(
100100
`${SERVER_SRC_DIR}${this.mainClientDir}/webpack/webpack.prod.js`,
101101
`${SERVER_SRC_DIR}${this.mainClientDir}/`,
@@ -119,8 +119,8 @@ function updateWebpackProdJs() {
119119

120120
function updateTsConfigJson() {
121121
this.replaceContent(`${SERVER_SRC_DIR}${this.mainClientDir}/tsconfig.json`, '"outDir": ".*"', '"outDir": "dist/src/app"', true);
122-
this.replaceContent(`${SERVER_SRC_DIR}${this.mainClientDir}/tsconfig.json`, `${SERVER_SRC_DIR}${this.mainClientDir}/`,"", true);
123-
this.replaceContent(`${SERVER_SRC_DIR}${this.mainClientDir}/tsconfig.app.json`, `${SERVER_SRC_DIR}${this.mainClientDir}/`,"", true);
122+
this.replaceContent(`${SERVER_SRC_DIR}${this.mainClientDir}/tsconfig.json`, `${SERVER_SRC_DIR}${this.mainClientDir}/`, "", true);
123+
this.replaceContent(`${SERVER_SRC_DIR}${this.mainClientDir}/tsconfig.app.json`, `${SERVER_SRC_DIR}${this.mainClientDir}/`, "", true);
124124
}
125125

126126
function updatePackageJson() {
@@ -150,8 +150,8 @@ function updatePackageJson() {
150150
);
151151
}
152152

153-
function updateJestConf(){
154-
if(this.clientFramework === ANGULAR || this.clientFramework === REACT ) {
153+
function updateJestConf() {
154+
if (this.clientFramework === ANGULAR || this.clientFramework === REACT) {
155155
this.replaceContent(
156156
`${SERVER_SRC_DIR}${this.mainClientDir}/jest.conf.js`,
157157
'/src/test/javascript',
@@ -170,7 +170,7 @@ function updateJestConf(){
170170
'..',
171171
true
172172
);
173-
} else if(this.clientFramework === VUE) {
173+
} else if (this.clientFramework === VUE) {
174174
this.replaceContent(
175175
`${SERVER_SRC_DIR}${this.mainClientDir}/test/jest.conf.js`,
176176
'/src/test/javascript',
@@ -192,7 +192,7 @@ function updateJestConf(){
192192
}
193193
}
194194

195-
function updateEsLinIgnore(){
195+
function updateEsLinIgnore() {
196196
this.replaceContent(
197197
`${SERVER_SRC_DIR}${this.mainClientDir}/.eslintignore`,
198198
'src/test/javascript',
@@ -211,16 +211,18 @@ function updateEsLinIgnore(){
211211
"",
212212
true
213213
);
214-
this.replaceContent(
215-
`${SERVER_SRC_DIR}${this.mainClientDir}/tsconfig.e2e.json`,
216-
`/${SERVER_SRC_DIR}${this.mainClientDir}`,
217-
"",
218-
true
219-
);
214+
if (this.protractorTests) {
215+
this.replaceContent(
216+
`${SERVER_SRC_DIR}${this.mainClientDir}/tsconfig.e2e.json`,
217+
`/${SERVER_SRC_DIR}${this.mainClientDir}`,
218+
"",
219+
true
220+
);
221+
}
220222
}
221223

222-
function updateTestFramework(){
223-
if(this.protractorTests){
224+
function updateTestFramework() {
225+
if (this.protractorTests) {
224226
this.replaceContent(
225227
`${SERVER_SRC_DIR}${this.mainClientDir}/test/protractor.conf.js`,
226228
'http://localhost:8080',
@@ -231,7 +233,7 @@ function updateTestFramework(){
231233
}
232234

233235
function updateVendor() {
234-
this.replaceContent(
236+
this.replaceContent(
235237
`${SERVER_SRC_DIR}${this.mainClientAppDir}/content/scss/vendor.scss`,
236238
`${SERVER_SRC_DIR}${this.mainClientDir}/src/content`,
237239
"..",
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* Copyright 2013-2021 the original author or authors from the JHipster project.
3+
*
4+
* This file is part of the JHipster project, see https://www.jhipster.tech/
5+
* for more information.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* https://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
const EntitiesClientGenerator = require('generator-jhipster/generators/entities-client');
20+
const chalk = require('chalk');
21+
const customizeDotnetPaths = require('../utils').customizeDotnetPaths;
22+
const constants = require('../generator-dotnetcore-constants');
23+
24+
const BLAZOR = constants.BLAZOR;
25+
const XAMARIN = constants.XAMARIN;
26+
27+
module.exports = class extends EntitiesClientGenerator {
28+
constructor(args, opts) {
29+
super(args, { fromBlueprint: true, ...opts }); // fromBlueprint variable is important
30+
31+
if (this.jhipsterConfig.baseName) {
32+
this.baseName = this.jhipsterConfig.baseName;
33+
this.clientFramework = this.jhipsterConfig.clientFramework;
34+
}
35+
}
36+
37+
get initializing() {
38+
return super._initializing();
39+
}
40+
41+
get loading() {
42+
return super._loading();
43+
}
44+
45+
get default() {
46+
return {
47+
...super._default(),
48+
customizeDotnetPaths,
49+
};
50+
}
51+
52+
get end() {
53+
return {
54+
rebuildClient() {
55+
if (!this.options.skipInstall && !this.skipClient && this.clientFramework !== BLAZOR && this.clientFramework !== XAMARIN) {
56+
const done = this.async();
57+
this.log(`\n${chalk.bold.green('Running `webapp:build` to update client app\n')}`);
58+
this.spawnCommand('npm', ['--prefix', `${constants.SERVER_SRC_DIR}${this.mainClientDir}`, 'run', 'webapp:build']).on(
59+
'close',
60+
() => {
61+
done();
62+
}
63+
);
64+
}
65+
},
66+
};
67+
}
68+
};

generators/entity-client/index.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable consistent-return */
2-
const chalk = require('chalk');
32
const EntityClientGenerator = require('generator-jhipster/generators/entity-client');
43
const constants = require('../generator-dotnetcore-constants');
54
const customizeDotnetPaths = require('../utils').customizeDotnetPaths;
@@ -71,21 +70,4 @@ module.exports = class extends EntityClientGenerator {
7170
get postWriting() {
7271
return super._postWriting();
7372
}
74-
75-
rebuildClient() {
76-
if (!this.options.skipInstall && !this.skipClient && this.clientFramework !== BLAZOR && this.clientFramework !== XAMARIN) {
77-
const done = this.async();
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(
80-
'close',
81-
() => {
82-
done();
83-
}
84-
);
85-
}
86-
}
87-
88-
get end() {
89-
return super._end();
90-
}
9173
};

generators/server/templates/dotnetcore/src/Project/Project.csproj.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
</Target>
115115
116116
<Target Name="RunWebPack" BeforeTargets="Build" DependsOnTargets="NpmInstall">
117-
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run webapp:build" Condition="'$(Configuration)'=='Debug'" />
118-
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run webapp:prod" Condition="'$(Configuration)'=='Release'" />
117+
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run webapp:build" IgnoreStandardErrorWarningFormat="true" Condition="'$(Configuration)'=='Debug'" />
118+
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run webapp:prod" IgnoreStandardErrorWarningFormat="true" Condition="'$(Configuration)'=='Release'" />
119119
</Target>
120120
121121
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>

0 commit comments

Comments
 (0)