diff --git a/.editorconfig b/.editorconfig index 644f80a3452e299583cd91c4ab1732eca9f82ec9..c2fa6a2d9fabda08a6803daef253661ac215914d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,19 +6,17 @@ root = true [*] -# Change these settings to your own preference -indent_style = space -indent_size = 4 -max_line_length = 180 - # We recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.{ts,tsx,js,json,css,scss,sql,ejs}] +# Change these settings to your own preference indent_style = space +indent_size = 4 + +[*.{ts,tsx,js,jsx,json,css,scss,yml,html,vue}] indent_size = 2 [*.md] diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..99225f6ecc41d7495386a796e27af506613e492c --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +node_modules/ +src/main/docker/ +src/test/javascript/jest.conf.js +webpack/ +target/ +build/ +node/ +postcss.config.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000000000000000000000000000000000..5fd4c97695093926e31012ddfc7d4b1d9e561be9 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,26 @@ +module.exports = { + root: true, + env: { + node: true, + }, + extends: [ + 'plugin:vue/essential', + 'eslint:recommended', + '@vue/typescript/recommended', + '@vue/prettier', + '@vue/prettier/@typescript-eslint', + ], + parserOptions: { + ecmaVersion: 2020, + }, + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + }, + ignorePatterns: ['**/src/main docker/**/*.js'], +}; diff --git a/.gitignore b/.gitignore index 520491fa3c3a9ab8b0583422b7ffb0b78e0fb0ce..5b171b4842986b08062a1e3511cf7b4fceb8b3bf 100644 --- a/.gitignore +++ b/.gitignore @@ -69,7 +69,12 @@ out/ ###################### # Visual Studio Code ###################### -.vscode/ +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace ###################### # Maven diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 00c792a5ec0083d1db268cb806b7b4d0a9390cf7..27c359abb1480b2ad2cc00e9136d07720f88721a 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,3 +1,3 @@ module.exports = { - '{,src/**/}*.{json,md,yml,ts,css,scss}': ['prettier --write', 'git add'] + '{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}': ['prettier --write'], }; diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000000000000000000000000000000000..80bcbed90c4f2b3d895d5086dc775e1bd8b32b43 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps = true diff --git a/.yo-rc.json b/.yo-rc.json index 67cdd249bb9ca2050f0f372abaf4718b6f03e9ab..62a677d7296d30f429ce87aff6c761b4876463ec 100644 --- a/.yo-rc.json +++ b/.yo-rc.json @@ -4,7 +4,7 @@ "packageName": "com.unantes.orientactive", "nativeLanguage": "fr" }, - "jhipsterVersion": "6.10.3", + "jhipsterVersion": "7.0.0", "applicationType": "monolith", "baseName": "orientactive", "packageName": "com.unantes.orientactive", @@ -43,11 +43,15 @@ "enableTranslation": true, "nativeLanguage": "fr", "languages": ["fr", "en"], - "blueprints": [ - { - "name": "generator-jhipster-vuejs", - "version": "1.9.2" - } - ] + "blueprints": [], + "skipUserManagement": false, + "withAdminUi": true, + "skipClient": false, + "skipServer": false, + "skipCheckLengthOfIdentifier": false, + "skipFakeData": false, + "pages": [], + "reactive": false, + "entities": ["Workspace", "Form", "Variable", "Screen", "Answer", "UserAction"] } } diff --git a/README.md b/README.md index 23d5678d81529b1a186e9d0715903b79c21d1ce0..255d288f6ac8f5b51b0f6e360c073613309af2dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # orientactive -This application was generated using JHipster 6.10.3, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v6.10.3](https://www.jhipster.tech/documentation-archive/v6.10.3). +This application was generated using JHipster 7.0.0, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v7.0.0](https://www.jhipster.tech/documentation-archive/v7.0.0). ## Development @@ -12,15 +12,19 @@ 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 install +``` +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. - ./mvnw - npm start +``` +./mvnw +npm 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. @@ -28,11 +32,11 @@ Add the `help` flag on any command to see how you can use it. For example, `npm The `npm run` command will list all of the scripts available to run for this project. -### Service workers +### PWA Support -Service workers are commented by default, to enable them please uncomment the following code. +JHipster ships with PWA (Progressive Web App) support, and it's turned off by default. One of the main components of a PWA is a service worker. -- The service worker registering script in index.html +The service worker initialization code is commented out by default. To enable it, uncomment the following code in `src/main/webapp/index.html`: ```html ``` -Note: workbox creates the respective service worker and dynamically generate the `service-worker.js` +Note: [Workbox](https://developers.google.com/web/tools/workbox/) powers JHipster's service worker. It dynamically generates the `service-worker.js` file. ### Managing dependencies For example, to add [Leaflet][] library as a runtime dependency of your application, you would run following command: - npm install --save --save-exact leaflet - -To benefit from TypeScript type definitions from [DefinitelyTyped][] repository in development, you would run following command: - - npm 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: -Edit [src/main/webapp/app/main.ts](src/main/webapp/app/main.ts) file: - ``` -import 'leaflet/dist/leaflet.js'; +npm install --save --save-exact leaflet ``` -Edit [src/main/webapp/content/scss/vendor.scss](src/main/webapp/content/scss/vendor.scss) file: +To benefit from TypeScript type definitions from [DefinitelyTyped][] repository in development, you would run following command: ``` -@import '~leaflet/dist/leaflet.scss'; +npm install --save-dev --save-exact @types/leaflet ``` -Note: there are still few other things remaining to do for Leaflet that we won't detail here. +Then you would import the JS and CSS files specified in library's installation instructions so that [Webpack][] knows about them: +Note: There are still a few other things remaining to do for Leaflet that we won't detail here. For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][]. -### Using vue-cli - -You can also use [Vue CLI][] to display the project using vue UI. - -For example, the following command: - - vue ui - -will generate open Vue Project Manager. From there, you'll be able to manage your project as any other Vue.js projects. - ### Doing API-First development using openapi-generator [OpenAPI-Generator]() is configured for this application. You can generate API code from the `src/main/resources/swagger/api.yml` definition file by running: @@ -103,12 +89,16 @@ Refer to [Doing API-First development][] for more details. To build the final jar and optimize the orientactive application for production, run: - ./mvnw -Pprod clean verify +``` +./mvnw -Pprod clean verify +``` This will concatenate and minify the client CSS and JavaScript files. It will also modify `index.html` so it references these new files. To ensure everything worked, run: - java -jar target/*.jar +``` +java -jar target/*.jar +``` Then navigate to [http://localhost:8080](http://localhost:8080) in your browser. @@ -118,17 +108,25 @@ Refer to [Using JHipster in production][] for more details. To package your application as a war in order to deploy it to an application server, run: - ./mvnw -Pprod,war clean verify +``` +./mvnw -Pprod,war clean verify +``` ## Testing To launch your application's tests, run: + +``` ./mvnw verify +``` ### Client tests -Unit tests are run by [Jest][] and written with [Jasmine][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with: +Unit tests are run by [Jest][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with: + +``` npm test +``` For more information, refer to the [Running tests page][]. @@ -140,7 +138,10 @@ Sonar is used to analyse code quality. You can start a local Sonar server (acces docker-compose -f src/main/docker/sonar.yml up -d ``` +Note: we have turned off authentication in [src/main/docker/sonar.yml](src/main/docker/sonar.yml) for out of the box experience while trying out SonarQube, for real use cases turn it back on. + You can run a Sonar analysis with using the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) or by using the maven plugin. + Then, run a Sonar analysis: ``` @@ -153,7 +154,6 @@ If you need to re-run the Sonar phase, please be sure to specify at least the `i ./mvnw initialize sonar:sonar ``` -or For more information, refer to the [Code quality page][]. ## Using Docker to simplify development (optional) @@ -161,15 +161,30 @@ For more information, refer to the [Code quality page][]. You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services. For example, to start a postgresql database in a docker container, run: + +``` docker-compose -f src/main/docker/postgresql.yml up -d +``` + To stop it and remove the container, run: + +``` docker-compose -f src/main/docker/postgresql.yml down +``` You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running: + +``` ./mvnw -Pprod verify jib:dockerBuild +``` + Then run: + +``` docker-compose -f src/main/docker/app.yml up -d +``` + For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`jhipster docker-compose`), which is able to generate docker configurations for one or several JHipster applications. ## Continuous Integration (optional) @@ -177,23 +192,21 @@ For more information refer to [Using Docker and Docker-Compose][], this page als To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information. [jhipster homepage and latest documentation]: https://www.jhipster.tech -[jhipster 6.10.3 archive]: https://www.jhipster.tech/documentation-archive/v6.10.3 -[using jhipster in development]: https://www.jhipster.tech/documentation-archive/v6.10.3/development/ -[using docker and docker-compose]: https://www.jhipster.tech/documentation-archive/v6.10.3/docker-compose -[using jhipster in production]: https://www.jhipster.tech/documentation-archive/v6.10.3/production/ -[running tests page]: https://www.jhipster.tech/documentation-archive/v6.10.3/running-tests/ -[code quality page]: https://www.jhipster.tech/documentation-archive/v6.10.3/code-quality/ -[setting up continuous integration]: https://www.jhipster.tech/documentation-archive/v6.10.3/setting-up-ci/ +[jhipster 7.0.0 archive]: https://www.jhipster.tech/documentation-archive/v7.0.0 +[using jhipster in development]: https://www.jhipster.tech/documentation-archive/v7.0.0/development/ +[using docker and docker-compose]: https://www.jhipster.tech/documentation-archive/v7.0.0/docker-compose +[using jhipster in production]: https://www.jhipster.tech/documentation-archive/v7.0.0/production/ +[running tests page]: https://www.jhipster.tech/documentation-archive/v7.0.0/running-tests/ +[code quality page]: https://www.jhipster.tech/documentation-archive/v7.0.0/code-quality/ +[setting up continuous integration]: https://www.jhipster.tech/documentation-archive/v7.0.0/setting-up-ci/ [node.js]: https://nodejs.org/ -[yarn]: https://yarnpkg.org/ [webpack]: https://webpack.github.io/ -[vue cli]: https://cli.vuejs.org/ [browsersync]: https://www.browsersync.io/ [jest]: https://facebook.github.io/jest/ [jasmine]: https://jasmine.github.io/2.0/introduction.html -[protractor]: https://www.protractortest.org/ +[protractor]: https://angular.github.io/protractor/ [leaflet]: https://leafletjs.com/ [definitelytyped]: https://definitelytyped.org/ [openapi-generator]: https://openapi-generator.tech [swagger-editor]: https://editor.swagger.io -[doing api-first development]: https://www.jhipster.tech/documentation-archive/v6.10.3/doing-api-first-development/ +[doing api-first development]: https://www.jhipster.tech/documentation-archive/v7.0.0/doing-api-first-development/ diff --git a/checkstyle.xml b/checkstyle.xml index 6e3dbafef82b229bf5903b076c25c5b3a985b961..5d5ae6595ea20f350cdc8bfdbb8a1fc1674292a6 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -1,6 +1,6 @@ + "https://checkstyle.org/dtds/configuration_1_3.dtd"> @@ -9,8 +9,7 @@ - +