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/RELEASE.md b/RELEASE.md index 114ba30..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 - autogenerated SNAPSHOT-Release diff --git a/gulpfile.js b/gulpfile.js index 7a76388..eebfa05 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: { @@ -139,7 +137,6 @@ gulp.task("lint", gulp.task("preview", gulp.series( "build", - "lint", gulp.parallel( "watch", "browser-sync" diff --git a/package.json b/package.json index 899af04..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.1", - "@conterra/mapapps-mocha-runner": "^1.1.1", - "@types/arcgis-js-api": "4.26.0", - "chai": "^4.3.7", - "ct-mapapps-browser-sync": "0.0.30", - "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 2c1d9af..05fd988 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 @@ -408,6 +426,13 @@ de.conterra.mapapps mapapps-maven-plugin + + + true + false + ${js.build.outputPath}/apps + ${project.build.directory} + @@ -435,13 +460,6 @@ - - - true - false - ${js.build.outputPath}/apps - ${project.build.directory} - maven-assembly-plugin @@ -494,11 +512,12 @@ ${project.build.directory}/webapp ${root.build.outputPath}/js - 4.15.1 + 4.18.1 + 1.5.30 ${mapapps.version} - 1.5.10 + 2.1.1 2.0.2 @@ -528,7 +547,7 @@ required --> true - true + false false @@ -561,6 +580,11 @@ ags-js-api4 test + + com.esri + terraformer-js + test + moment-js moment-js @@ -571,6 +595,11 @@ apprt-polyfill test + + de.conterra.js + reactivity + test + 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/bundles/dn_hierarchicalsearch/HierarchicalSearchController.ts b/src/main/js/bundles/dn_hierarchicalsearch/HierarchicalSearchController.ts index f673fa4..22956d4 100644 --- a/src/main/js/bundles/dn_hierarchicalsearch/HierarchicalSearchController.ts +++ b/src/main/js/bundles/dn_hierarchicalsearch/HierarchicalSearchController.ts @@ -21,7 +21,7 @@ import type { InjectedReference } from "apprt-core/InjectedReference"; import ServiceResolver from "apprt/ServiceResolver"; import ct_util from "ct/ui/desktop/util"; import Filter from "ct/store/Filter"; -import ComplexQueryToSQL from "ct/store/ComplexQueryToSQL"; +import {toSQLWhere} from "store-api/rest/ComplexQueryToSQL"; import Query from "esri/rest/support/Query"; import * as query from "esri/rest/query"; import HierarchicalSearchModel from "./HierarchicalSearchModel"; @@ -172,7 +172,7 @@ export default class HierarchicalSearchController { queryObject.where = "1=1"; } else { const complexQuery = this.getComplexQuery(); - queryObject.where = ComplexQueryToSQL.toSQLWhere(complexQuery, {}); + queryObject.where = toSQLWhere(complexQuery, {}); } query.executeQueryJSON(this.store.target, queryObject).then(function (response) { response.features.forEach((feature) => { 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/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 68bef32..2c86832 100644 --- a/src/test/webapp/js/tests/test-init.js +++ b/src/test/webapp/js/tests/test-init.js @@ -13,14 +13,14 @@ * 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..", - packages: [ - // register all self hosted packages - "*" - ] - } + //root: "url to registry..", + packages: [ + // register all self hosted packages + "*" + ]} //uncomment, if project runs in remote mode // ,{ // root: "@@mapapps.remote.base@@/resources/jsregistry/root", diff --git a/tsconfig.json b/tsconfig.json index f33e19d..ff7e3ae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,14 +2,18 @@ "compilerOptions": { "target": "ESNext", "module": "ESNext", - "moduleResolution": "node", + "moduleResolution": "bundler", "baseUrl": ".", "paths": { "*": ["./src/main/js/bundles/*", "./node_modules/@conterra/ct-mapapps-typings/*"] }, "allowJs": true, "noEmit": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, "skipLibCheck": true, "esModuleInterop": true - } + }, + "include": ["src"] }