From 08b5b2dcb976b84432e26177b9e31bb4a33e2e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20Br=C3=B6ker?= Date: Tue, 11 Jun 2024 17:08:56 +0200 Subject: [PATCH] DN-34: Updated to map.apps 4.18.1 --- README.md | 20 ++++---- RELEASE.md | 2 +- package.json | 12 +++-- pom.xml | 72 ++++++++++++++++++++++----- src/main/config/assembly.xml | 2 +- src/main/js/apps/sample/app.js | 16 ------ src/main/js/apps/sample/app.json | 6 +-- src/main/types/mocha-global.d.ts | 1 + src/main/types/thirdparty.d.ts | 7 +++ src/main/types/vue-shim.d.ts | 4 ++ src/test/webapp/index.html | 2 +- src/test/webapp/js/tests/test-init.js | 1 + tsconfig.json | 2 +- 13 files changed, 97 insertions(+), 50 deletions(-) delete mode 100644 src/main/js/apps/sample/app.js create mode 100644 src/main/types/mocha-global.d.ts create mode 100644 src/main/types/thirdparty.d.ts create mode 100644 src/main/types/vue-shim.d.ts diff --git a/README.md b/README.md index 6cddebb..de573e0 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,19 @@ Simply add the bundle "dn_editingusernameprocessor" to your app. [dn_editingusernameprocessor Documentation](https://github.com/conterra/mapapps-editing-usernameprocessor/tree/master/src/main/js/bundles/dn_editingusernameprocessor) -## Development Guide +## Quick start -### Define the mapapps remote base +Clone this project and ensure that you have all required dependencies installed correctly (see [Documentation](https://docs.conterra.de/en/mapapps/latest/developersguide/getting-started/set-up-development-environment.html)). -Before you can run the project you have to define the mapapps.remote.base property in the pom.xml-file: -`http://%YOURSERVER%/ct-mapapps-webapp-%VERSION%` +Then run the following commands from the project root directory to start a local development server: -### Other methods to to define the mapapps.remote.base property. +```bash +# install all required node modules +$ mvn initialize -1. Goal parameters - `mvn install -Dmapapps.remote.base=http://%YOURSERVER%/ct-mapapps-webapp-%VERSION%` +# start dev server +$ mvn compile -Denv=dev -Pinclude-mapapps-deps -2. Build properties Change the mapapps.remote.base in the build.properties file and run: - `mvn install -Denv=dev -Dlocal.configfile=%ABSOLUTEPATHTOPROJECTROOT%/build.properties` +# run unit tests +$ mvn test -P run-js-tests,include-mapapps-deps +``` diff --git a/RELEASE.md b/RELEASE.md index ed14746..b14d54e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,4 @@ -✅ Tested for map.apps 4.16.0 / Linie 4 +✅ Tested for map.apps 4.18.1 / Linie 4 #### Release Notes - autogenerated SNAPSHOT-Release diff --git a/package.json b/package.json index 885ba70..6c71dea 100644 --- a/package.json +++ b/package.json @@ -9,15 +9,16 @@ "watch-types": "tsc -w --noEmit" }, "devDependencies": { - "@conterra/ct-mapapps-typings": "~4.16.0", + "@conterra/ct-mapapps-typings": "~4.18.1", "@conterra/mapapps-mocha-runner": "1.1.1", - "@types/arcgis-js-api": "4.28.0", + "@conterra/reactivity-core": "^0.4.0", "@types/chai": "4.3.10", "@types/license-checker": "^25.0.6", "@types/mocha": "10.0.4", + "arcgis-js-api": "4.29.10", "chai": "4.3.10", - "ct-mapapps-browser-sync": "0.0.34", - "ct-mapapps-gulp-js": "0.10.2", + "ct-mapapps-browser-sync": "0.0.39", + "ct-mapapps-gulp-js": "0.10.3", "eslint-config-ct-prodeng": "1.4.0", "license-checker": "25.0.1", "mocha": "10.2.0", @@ -28,7 +29,8 @@ "stylelint-config-recommended-less": "2.0.0", "ts-node": "^10.9.1", "tsx": "^4.6.0", - "typescript": "5.2.2", + "typescript": "5.4.5", + "vue": "2.7.15", "vue-template-compiler": "2.7.15" } } diff --git a/pom.xml b/pom.xml index 01a099a..6cb0c22 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,8 @@ limitations under the License. --> - 4.0.0 de.conterra.devnet @@ -90,6 +91,10 @@ ct-jsregistry-maven-plugin ${ct.jsregistry.version} + + maven-deploy-plugin + 2.8.2 + org.apache.maven.plugins maven-resources-plugin @@ -165,11 +170,6 @@ setproperties-maven-plugin 1.0.2 - - de.conterra.jsrt - ct-jsrt-test-maven-plugin - ${ct.jsrt-test.version} - src/main/js @@ -195,6 +195,29 @@ + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.1 + + + enforce-versions + + enforce + + + + + [3.8.0,) + + + [17,) + + + + + + de.conterra.maven setproperties-maven-plugin @@ -207,9 +230,7 @@ - - . @@ -336,6 +357,9 @@ **/gulpfile.js **/pom.xml + + src/main/js/**/*.min.js + XML_STYLE @@ -405,6 +429,7 @@ true + false ${js.build.outputPath}/apps ${project.build.directory} @@ -416,6 +441,24 @@ deployApps + + build-app-template + prepare-package + + deployAppTemplate + + + ${project.build.directory}/${project.artifactId}-sample-app.zip + + + ${js.build.outputPath}/apps/sample + + **/* + + + + + @@ -470,12 +513,12 @@ ${project.build.directory}/webapp ${root.build.outputPath}/js - 4.16.0 - 1.5.28 + 4.18.1 + 1.5.30 ${mapapps.version} - 1.5.14 + 2.1.1 2.0.2 @@ -505,7 +548,7 @@ required --> true - true + false false @@ -553,6 +596,11 @@ apprt-polyfill test + + de.conterra.js + reactivity + test + diff --git a/src/main/config/assembly.xml b/src/main/config/assembly.xml index 6b234e8..0441c06 100644 --- a/src/main/config/assembly.xml +++ b/src/main/config/assembly.xml @@ -34,4 +34,4 @@ . - + \ No newline at end of file diff --git a/src/main/js/apps/sample/app.js b/src/main/js/apps/sample/app.js deleted file mode 100644 index 63b0846..0000000 --- a/src/main/js/apps/sample/app.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2023 con terra GmbH (info@conterra.de) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import i18n from "dojo/i18n!./nls/bundle"; diff --git a/src/main/js/apps/sample/app.json b/src/main/js/apps/sample/app.json index e34c588..e316c67 100644 --- a/src/main/js/apps/sample/app.json +++ b/src/main/js/apps/sample/app.json @@ -23,10 +23,8 @@ "basemaptoggler", "mapnavigation", "popups-default", - "dn_editingusernameprocessor" - ], - "require": [ - "${app}.app" + "dn_editingusernameprocessor", + "console" ], "i18n": [ "bundle" diff --git a/src/main/types/mocha-global.d.ts b/src/main/types/mocha-global.d.ts new file mode 100644 index 0000000..7ae74ef --- /dev/null +++ b/src/main/types/mocha-global.d.ts @@ -0,0 +1 @@ +declare const testConfig: (opts?: Record) => void; diff --git a/src/main/types/thirdparty.d.ts b/src/main/types/thirdparty.d.ts new file mode 100644 index 0000000..476971b --- /dev/null +++ b/src/main/types/thirdparty.d.ts @@ -0,0 +1,7 @@ +/* + * Copyright (C) con terra GmbH + */ + +declare module "dojo/*"; +declare module "dijit/*"; +declare module "dojox/*"; diff --git a/src/main/types/vue-shim.d.ts b/src/main/types/vue-shim.d.ts new file mode 100644 index 0000000..d6e6b86 --- /dev/null +++ b/src/main/types/vue-shim.d.ts @@ -0,0 +1,4 @@ +declare module "*.vue" { + import Vue from "vue"; + export default Vue; +} diff --git a/src/test/webapp/index.html b/src/test/webapp/index.html index b73c7d7..3095995 100644 --- a/src/test/webapp/index.html +++ b/src/test/webapp/index.html @@ -59,7 +59,7 @@ proxyUrl: url }); }); - var trustedServers = "@@cors.request.trustedServers@@".split("\s*,\s*") + var trustedServers = "@@cors.request.trustedServers@@".split(/\s*,\s*/) .filter(function(item){ return item && item.match(/^[^@.].*$/)}); $apprt.changeConfig({ isDebug: true, diff --git a/src/test/webapp/js/tests/test-init.js b/src/test/webapp/js/tests/test-init.js index 267060e..2c86832 100644 --- a/src/test/webapp/js/tests/test-init.js +++ b/src/test/webapp/js/tests/test-init.js @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// eslint-disable-next-line no-undef testConfig({ jsregistry: [{ //root: "url to registry..", diff --git a/tsconfig.json b/tsconfig.json index c1df1bb..ff7e3ae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ESNext", "module": "ESNext", - "moduleResolution": "node", + "moduleResolution": "bundler", "baseUrl": ".", "paths": { "*": ["./src/main/js/bundles/*", "./node_modules/@conterra/ct-mapapps-typings/*"]