diff --git a/.eslintrc b/.eslintrc index c20bc85..ae8ae61 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,6 @@ { - "extends": "eslint-config-ct-prodeng", - "plugins": [ - "vue" - ] + "extends": "eslint-config-ct-prodeng", + "plugins": [ + "vue" + ] } diff --git a/.gitignore b/.gitignore index cc762e4..e41ab5f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /.vscode/settings.json /.externalToolBuilders/ /package-lock.json +/gulpfile.overrides.js diff --git a/.stylelintignore b/.stylelintignore new file mode 100644 index 0000000..b07fa47 --- /dev/null +++ b/.stylelintignore @@ -0,0 +1,3 @@ +# add path patterns to ignore style files +**/external-libs/** +**/styles/dijit/** \ No newline at end of file diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 0000000..57c90c1 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,3 @@ +{ + "extends": "stylelint-config-ct-prodeng" +} diff --git a/README.md b/README.md index 9ce7e36..b57ba2f 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,19 @@ https://demos.conterra.de/mapapps/resources/apps/downloads_highlight-config/inde [dn_highlightconfig Documentation](https://github.com/conterra/mapapps-highlight-config/tree/master/src/main/js/bundles/dn_highlightconfig) -## Development Guide -### Define the mapapps remote base -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%` - -### Other methods to to define the mapapps.remote.base property. -1. Goal parameters -`mvn install -Dmapapps.remote.base=http://%YOURSERVER%/ct-mapapps-webapp-%VERSION%` - -2. Build properties -Change the mapapps.remote.base in the build.properties file and run: -`mvn install -Denv=dev -Dlocal.configfile=%ABSOLUTEPATHTOPROJECTROOT%/build.properties` +## Quick start + +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)). + +Then run the following commands from the project root directory to start a local development server: + +```bash +# install all required node modules +$ mvn initialize + +# start dev server +$ mvn compile -Denv=dev -Pinclude-mapapps-deps + +# run unit tests +$ mvn test -P run-js-tests,include-mapapps-deps +``` diff --git a/RELEASE.md b/RELEASE.md index d0ff34f..b14d54e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,4 @@ -✅ Tested for map.apps 4.15.0 / Linie 4 +✅ Tested for map.apps 4.18.1 / Linie 4 #### Release Notes -- SNAPSHOT-Release +- autogenerated SNAPSHOT-Release diff --git a/gulpfile.js b/gulpfile.js index 873c60a..57d3f38 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -64,15 +64,13 @@ mapapps.registerTasks({ }, /* a list of themes inside this project */ - themes: [/*"sample-theme"*/], + themes: [], /* state that the custom theme will be dependant from map.apps everlasting theme that provides the base styles */ hasBaseThemes: true, /* state that we want to support vuetify components and therefore need the vuetify core styles*/ hasVuetify: true, themeChangeTargets: { - "vuetify": [ - // "sample_theme" - ] + "vuetify": [] }, /* A list oft target browser versions. This should be streamlined with Esri JS API requirements. */ transpileTargets: { @@ -98,7 +96,12 @@ mapappsBrowserSync.registerTask({ // to prevent auto open of browser, set this to false urlToOpen: localOverrides?.openBrowser ?? true, - + properties: { + paths: [ + // Ensure @@key@@ expressions filtered in tests files + /^\/js\/tests\/(runTests.html|test-init.js|init-packs.js)$/ + ] + }, jsreg: { //npmDir : __dirname + "/node_modules/", npmModules: [ @@ -126,7 +129,9 @@ gulp.task("build", gulp.task("lint", gulp.parallel( "js-lint" - //,"style-lint" + /*, comment in to lint .css/.less files + "style-lint" + */ )); gulp.task("preview", diff --git a/package.json b/package.json index 67a74ba..6c71dea 100644 --- a/package.json +++ b/package.json @@ -4,22 +4,33 @@ "version": "0.0.1", "license": "CC0-1.0", "scripts": { - "check-licenses": "node ./src/support/js/check-licenses.js" + "check-licenses": "tsx ./src/support/js/check-licenses.ts", + "check-types": "tsc --noEmit", + "watch-types": "tsc -w --noEmit" }, "devDependencies": { - "@conterra/ct-mapapps-typings": "4.15.0", - "@conterra/mapapps-mocha-runner": "^1.1.1", - "@types/arcgis-js-api": "4.26.0", - "chai": "^4.3.7", - "ct-mapapps-browser-sync": "0.0.27", - "ct-mapapps-gulp-js": "0.9.4", - "eslint-config-ct-prodeng": "1.3.0-next-2", - "license-checker": "^25.0.1", - "mocha": "^10.2.0", - "puppeteer": "^19.11.1", - "vue-template-compiler": "2.7.8", - "stylelint-config-ct-prodeng": "1.0.4", - "stylelint-config-recommended": "5.0.0", - "stylelint": "^13.13.1" + "@conterra/ct-mapapps-typings": "~4.18.1", + "@conterra/mapapps-mocha-runner": "1.1.1", + "@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.39", + "ct-mapapps-gulp-js": "0.10.3", + "eslint-config-ct-prodeng": "1.4.0", + "license-checker": "25.0.1", + "mocha": "10.2.0", + "puppeteer": "21.5.2", + "stylelint": "15.11.0", + "stylelint-config-ct-prodeng": "2.0.0", + "stylelint-config-recommended": "13.0.0", + "stylelint-config-recommended-less": "2.0.0", + "ts-node": "^10.9.1", + "tsx": "^4.6.0", + "typescript": "5.4.5", + "vue": "2.7.15", + "vue-template-compiler": "2.7.15" } } diff --git a/pom.xml b/pom.xml index ed8d058..7f1dbe2 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,8 @@ limitations under the License. --> - 4.0.0 de.conterra.devnet @@ -46,11 +47,6 @@ pom import - - de.conterra.mapapps - ct-mapapps-js - ${mapapps.version} - @@ -81,7 +77,6 @@ ${ct.jsrt-test.version} test - @@ -96,6 +91,10 @@ ct-jsregistry-maven-plugin ${ct.jsregistry.version} + + maven-deploy-plugin + 2.8.2 + org.apache.maven.plugins maven-resources-plugin @@ -143,10 +142,9 @@ com.github.eirslett frontend-maven-plugin - 1.12.1 + 1.14.2 - v18.13.0 - 8.19.3 + v20.9.0 @@ -172,11 +170,6 @@ setproperties-maven-plugin 1.0.2 - - de.conterra.jsrt - ct-jsrt-test-maven-plugin - ${ct.jsrt-test.version} - src/main/js @@ -202,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 @@ -214,9 +230,7 @@ - - . @@ -224,7 +238,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.11.0 true @@ -232,7 +246,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.5.0 true @@ -240,6 +254,7 @@ org.apache.maven.plugins maven-dependency-plugin + 3.5.0 unpack-themes-src @@ -342,6 +357,9 @@ **/gulpfile.js **/pom.xml + + src/main/js/**/*.min.js + XML_STYLE @@ -394,7 +412,8 @@ buildPacksProperties - + apps/**,bundles/sample_tests @@ -407,6 +426,13 @@ de.conterra.mapapps mapapps-maven-plugin + + + true + false + ${js.build.outputPath}/apps + ${project.build.directory} + @@ -434,13 +460,6 @@ - - - true - false - ${js.build.outputPath}/apps - ${project.build.directory} - maven-assembly-plugin @@ -494,11 +513,12 @@ ${project.build.directory}/webapp ${root.build.outputPath}/js - 4.15.0 + 4.18.1 + 1.5.30 ${mapapps.version} - 1.5.9 + 2.1.1 2.0.2 @@ -561,6 +581,11 @@ ags-js-api4 test + + com.esri + terraformer-js + test + moment-js moment-js @@ -571,6 +596,11 @@ apprt-polyfill test + + de.conterra.js + reactivity + test + 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/support/js/check-licenses.js b/src/support/js/check-licenses.ts similarity index 84% rename from src/support/js/check-licenses.js rename to src/support/js/check-licenses.ts index 8ce6054..9eda7f4 100644 --- a/src/support/js/check-licenses.js +++ b/src/support/js/check-licenses.ts @@ -3,7 +3,7 @@ Fails with exit code != 0 and an error message if a disallowed license is encountered. The script should be executed from the project root directory after dependencies have been installed: - $ ./node/node ./src/support/js/check-licenses.js + $ tsx ./src/support/js/check-licenses.ts To run checks yourself (e.g. to update the allow list or to get details), install license-checker yourself and run it from the project root directory: @@ -15,8 +15,8 @@ See also https://www.npmjs.com/package/license-checker */ -const checker = require("license-checker"); -const process = require("process"); +import { init as initChecker } from "license-checker"; +import { cwd, exit} from "node:process"; // Licenses known to be OK. const ACCEPTED_LICENSES = [ @@ -41,17 +41,19 @@ const SKIP_PACKAGES = [ "taffydb@2.6.2" // BSD-1-Clause License in source code ]; -checker.init( +initChecker( { - start: process.cwd(), + start: cwd(), onlyAllow: ACCEPTED_LICENSES.join(";"), excludePackages: SKIP_PACKAGES.join(";") }, (error, packages) => { + void packages; // currently unused + if (error) { console.error("Error: ", error); - process.exit(1); + exit(1); } - process.exit(0); + exit(0); } ); diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 6255c81..5342c09 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -34,9 +34,6 @@ client.config.initjs=$\{mapapps.remote.base\}/resources/jsregistry/root/apprt-bo # or change the name of the main layer file client.config.mainlayerfiles=apprt/launch/layer -#local (embedded) js registry root url -jsregistry.root.url=${applicationURL.noscheme}/resources/jsregistry/root - # This is used to filter a default app name in the *.html files default.app.name=${default.app.name} @@ -47,12 +44,6 @@ default.app.name=${default.app.name} # [,,];\ (username/password currently not encrypted) proxy.allowedServerUrls=${proxy.allowedServerUrls} -# the following is support for proxied ssl connections -# if you configure '*' then you trust all ssl server certificates -# you can also confige the dns of the certificate subjects to trust them, separated by '|' -# or leave the configuration empty, then the normal java mechanism is used. -proxy.allowedSSLDNs=${proxy.allowedSSLDNs} - # Defines rules for proxy access based on host names. # It provides more fine grained control what requests use a proxy page. # Sample: @@ -70,16 +61,6 @@ proxy.use.rules=${proxy.use.rules} # http://servicesbeta.esri.com,http://server.organization.com cors.request.trustedServers=${cors.request.trustedServers} -jsregistry.replacement.paths=**/tests/*.html - -jsregistry.directoryscanner.npmfolder=${basedir}/node_modules -jsregistry.directoryscanner.npmincludes=mocha,chai,@conterra,@conterra/mapapps-mocha-runner - -# Set to true to allow that *.js.map files are delivered. Default is false. -# This option should be set to true only for stage or development systems. -# It allows better debugging of errors, but may open details of the JavaScript Source code to attackers. -jsregistry.sourcemaps.enabled=true - # Enable debug logging (in browser console). client.config.logging=DEBUG @@ -106,5 +87,3 @@ security.identity.self.service.url=$\{security.self.service.url\} #security.login.base=http://localhost:8080 #esri.api.arcgisPortalUrl=https://myhost.example.com/portal #proxy.allowedServerUrls=http://localhost:8080/**,trusted:true; - - diff --git a/src/test/webapp/WEB-INF/web.xml b/src/test/webapp/WEB-INF/web.xml index 47a22e5..fc35e73 100644 --- a/src/test/webapp/WEB-INF/web.xml +++ b/src/test/webapp/WEB-INF/web.xml @@ -5,7 +5,7 @@ version="3.0"> map.apps sample - + @@ -18,7 +18,7 @@ ProxyServlet /proxy - +