Skip to content

Commit

Permalink
Improve readme and update node version (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas63 committed May 1, 2020
1 parent 3bdd9be commit 71e4a1b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-jwt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node_version: [12.14.0]
node_version: [12.16.1]
os: [ubuntu-latest]
app-type:
- jwt-with-angular-app
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-oauth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node_version: [12.14.0]
node_version: [12.16.1]
os: [ubuntu-latest]
app-type:
- oauth-with-angular-app
Expand Down
32 changes: 14 additions & 18 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
{
"type": "node",
"request": "launch",
"name": "JHipster Mocha Tests",

"name": "JHipster Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
Expand All @@ -23,68 +22,65 @@
"type": "node",
"request": "launch",
"name": "jhipster generate dotnetcore blueprint",
"program": "${workspaceFolder}/node_modules/generator-jhipster/cli/jhipster.js",
"runtimeExecutable": "jhipster",
"timeout": 100000,
"args": [
"-d",
"--skip-checks",
"--skip-git",
"--skip-cache",
"--skip-install",
"--no-insight",
"--blueprints",
"dotnetcore"
],
"cwd": "${workspaceFolder}/test-integration/samples/app-sample-dev",
"cwd": "${workspaceFolder}/test-integration/samples/jwt-with-angular-app",
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "jhipster entity",

"program": "${workspaceFolder}/node_modules/generator-jhipster/cli/jhipster.js",
"name": "jhipster entity",
"runtimeExecutable": "jhipster",
"args": [
"entity",
"BankAccount",
"--force"
],
"cwd": "${workspaceFolder}/test-integration/samples/app-sample-dev",
"cwd": "${workspaceFolder}/test-integration/samples/jwt-with-angular-app",
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "jhipster info",

"program": "${workspaceFolder}/node_modules/generator-jhipster/cli/jhipster.js",
"name": "jhipster info",
"runtimeExecutable": "jhipster",
"args": [
"info"
],
"cwd": "${workspaceFolder}/test-integration/samples/app-sample-dev",
"cwd": "${workspaceFolder}/test-integration/samples/jwt-with-angular-app",
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "jhipster language",

"program": "${workspaceFolder}/node_modules/generator-jhipster/cli/jhipster.js",
"runtimeExecutable": "jhipster",
"args": [
"language"
],
"cwd": "${workspaceFolder}/test-integration/samples/app-sample-dev",
"cwd": "${workspaceFolder}/test-integration/samples/jwt-with-angular-app",
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "jhipster upgrade",

"program": "${workspaceFolder}/node_modules/generator-jhipster/cli/jhipster.js",
"runtimeExecutable": "jhipster",
"args": [
"upgrade"
],
"cwd": "${workspaceFolder}/test-integration/samples/app-sample-dev"
"cwd": "${workspaceFolder}/test-integration/samples/jwt-with-angular-app"
}
]
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

> JHipster blueprint,
# Analysis of the sample project
# Analysis of the sample project
https://github.com/jhipster/jhipster-sample-app-dotnetcore

[![Sonar Cloud Quality Gate][sonar-sample-gate-image]][sonar-sample-url]
[![Sonar Cloud Coverage Rate][sonar-sample-coverage-image]][sonar-sample-coverage-url]
Expand Down Expand Up @@ -170,7 +171,7 @@ In case of Oracle database, see [official documentation](https://github.com/orac
```dotnet tool install --global dotnet-sonarscanner```
3. Run ```dotnet sonarscanner begin /d:sonar.login=admin /d:sonar.password=admin /k:"AwesomeKey" /d:sonar.host.url="http://localhost:9001"```
3. Run ```dotnet sonarscanner begin /d:sonar.login=admin /d:sonar.password=admin /k:"AwesomeKey" /d:sonar.host.url="http://localhost:9001" /s:$pwd/SonarQube.Analysis.xml```
4. Build your application : ```dotnet build```
Expand Down
55 changes: 29 additions & 26 deletions generators/common/templates/dotnetcore/README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<%_
let DOCUMENTATION_ARCHIVE_URL = `${DOCUMENTATION_URL + DOCUMENTATION_ARCHIVE_PATH}v${jhipsterVersion}`;
_%>
This application was generated using JHipster <%= jhipsterVersion %> and JHipster .Net Core 0.1.0, you can find documentation and help at [<%= DOCUMENTATION_ARCHIVE_URL %>](<%= DOCUMENTATION_ARCHIVE_URL %>).
This application was generated using JHipster <%= jhipsterVersion %> and JHipster .Net Core 0.3.0, you can find documentation and help at [<%= DOCUMENTATION_ARCHIVE_URL %>](<%= DOCUMENTATION_ARCHIVE_URL %>).

## Development

Expand All @@ -39,21 +39,23 @@ Before you can build this project, you must install and configure the following
After installing Node, you should be able to run the following command to install development tools.
You will only need to run this command when dependencies change in [package.json](package.json).
npm --prefix ./src/<%= pascalizedBaseName %> install
In ./src/<%= pascalizedBaseName %>/ClientApp run
npm install
We use npm scripts and [Webpack][] as our build system.
Run the following commands in two separate terminals to create a blissful development experience where your browser
auto-refreshes when files change on your hard drive.
dotnet run --verbosity normal --project ./src/<%= pascalizedBaseName %>/<%= pascalizedBaseName %>.csproj
npm --prefix ./src/<%= pascalizedBaseName %> start
npm --prefix ./src/<%= pascalizedBaseName %>/ClientApp start
npm is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
specifying a newer version in [package.json](package.json). You can also run `npm update` and `npm install` to manage dependencies.
Add the `help` flag on any command to see how you can use it. For example, `npm help update`.
The `npm --prefix ./src/<%= pascalizedBaseName %> run` command will list all of the scripts available to run for this project.
The `npm --prefix ./src/<%= pascalizedBaseName %>/ClientApp run` command will list all of the scripts available to run for this project.
### Service workers
Expand All @@ -77,11 +79,11 @@ Note: workbox creates the respective service worker and dynamically generate the
For example, to add [Leaflet][] library as a runtime dependency of your application, you would run following command:
npm --prefix ./src/<%= pascalizedBaseName %> install --save --save-exact leaflet
npm --prefix ./src/<%= pascalizedBaseName %>/ClientApp install --save --save-exact leaflet
To benefit from TypeScript type definitions from [DefinitelyTyped][] repository in development, you would run following command:
npm --prefix ./src/<%= pascalizedBaseName %> install --save-dev --save-exact @types/leaflet
npm --prefix ./src/<%= pascalizedBaseName %>/ClientApp install --save-dev --save-exact @types/leaflet
Then you would import the JS and CSS files specified in library's installation instructions so that [Webpack][] knows about them:
<%_ if (clientFramework === 'angularX') { _%>
Expand Down Expand Up @@ -111,9 +113,9 @@ For example, the following command:
will generate few files:
create <%= mainClientDir %>/app/my-component/my-component.component.html
create <%= mainClientDir %>/app/my-component/my-component.component.ts
update <%= mainClientDir %>/app/app.module.ts
create <%= mainClientDir %>/src/app/my-component/my-component.component.html
create <%= mainClientDir %>/src/app/my-component/my-component.component.ts
update <%= mainClientDir %>/src/app/app.module.ts
<%_ } _%>

## Building for production
Expand All @@ -138,18 +140,29 @@ To launch your application's tests, run:
<% if (!skipClient) { %>
### Client tests
// TODO
In ClientApp folder run :
npm test
<%_ } _%>

### Code quality

By Script :

1. Run Sonar in container : ```docker-compose -f ./docker/sonar.yml up -d```

2. Wait container was up Run ```SonarAnalysis.ps1``` and go to http://localhost:9001

Manually :

1. Run Sonar in container : ```docker-compose -f ./docker/sonar.yml up -d```

2. Install sonar scanner for .net :

```dotnet tool install --global dotnet-sonarscanner```

3. Run ```dotnet sonarscanner begin /d:sonar.login=admin /d:sonar.password=admin /k:"AwesomeKey" /d:sonar.host.url="http://localhost:9001"```
3. Run ```dotnet sonarscanner begin /d:sonar.login=admin /d:sonar.password=admin /k:"AwesomeKey" /d:sonar.host.url="http://localhost:9001" /s:$pwd/SonarQube.Analysis.xml```

4. Build your application : ```dotnet build```

Expand All @@ -159,21 +172,15 @@ To launch your application's tests, run:

### Monitoring

1. Run container : ```docker-compose -f ./docker/monitoring.yml up -d```
1. Run container (uncomment chronograf and kapacitor if you would use it): ```docker-compose -f ./docker/monitoring.yml up -d```

2. Go to http://localhost:8888
2. Go to http://localhost:3000 (or http://localhost:8888 if you use chronograf)

3. Change influxdb connection string by ```YourApp-influxdb```
3. (Only for chronograf) Change influxdb connection string by ```YourApp-influxdb```

3. Change kapacitor connection string by ```YourApp-kapacitor```
4. (Only for chronograf) Change kapacitor connection string by ```YourApp-kapacitor```

4. You can now add dashboard (like docker), see your app log in Cronograf Log viewer and send alert with kapacitor

//TODO

## Using Docker to simplify development (optional)

// TODO
5. (Only for chronograf) You can now add dashboard (like docker), see your app log in Cronograf Log viewer and send alert with kapacitor

## Build a Docker image

Expand All @@ -185,10 +192,6 @@ Then run:

docker run -p 80:80 <%= baseName %>

## Continuous Integration (optional)

// TODO

<% if (testFrameworks.includes("gatling")) { %>[Gatling]: http://gatling.io/<% } %>
<%_ if (!skipClient) {_%>
[Node.js]: https://nodejs.org/
Expand Down

0 comments on commit 71e4a1b

Please sign in to comment.