diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index b80016c..0000000 --- a/.prettierrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "semi": true, - "tabWidth": 4, - "trailingComma": "none", - "singleQuote": false, - "quoteProps": "consistent" -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..95f81be --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "vue.volar", + "Esri.arcgis-jsapi-snippets", + "ctjdr.vscode-apprt-bundles" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..29fadc6 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:9090", + "webRoot": "${workspaceFolder}/src/main" + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2bf60ba..2b6be7e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -13,7 +13,7 @@ "detail": "Run mapapps-github-manager development server", "type": "shell", "command": "mvn", - "args": ["compile", "-Denv=dev", "'-Dlocal.configfile=./build.properties'", "-Pinclude-mapapps-deps"], + "args": ["clean", "compile", "-Denv=dev", "'-Dlocal.configfile=./build.properties'", "-Pinclude-mapapps-deps"], "group": "build", "isBackground": true }, @@ -22,7 +22,7 @@ "detail": "Run mapapps-github-manager development server in 'remote project' mode", "type": "shell", "command": "mvn", - "args": ["compile", "-Denv=dev", "'-Dlocal.configfile=./build.properties'"], + "args": ["clean", "compile", "-Denv=dev", "'-Dlocal.configfile=./build.properties'"], "group": "build", "isBackground": true }, @@ -31,7 +31,7 @@ "detail": "Prepare bundles and apps for deployment on a map.apps instance", "type": "shell", "command": "mvn", - "args": ["install", "-Pcompress"], + "args": ["clean", "install", "-Pcompress"], "group": "build", "presentation": { "reveal": "always", diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 6ecfa46..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env groovy -def releaseParams = [:]; -def buildParams = [:]; - -def testStageWasExecute = false; - -def updateVersions(targetversion,pushChanges=false){ - echo "update versions in manifest.json files to ${targetversion}" - sh "mvn validate -P write-release-versions -Dreplace.target.version=${targetversion}" - echo "update versions in pom.xml files to ${targetversion}" - sh "mvn versions:set -DnewVersion=${targetversion} -DgenerateBackupPoms=false" - sh "mvn scm:checkin -DpushChanges=${pushChanges} -Dmessage=\"[update-version] to ${targetversion}\"" -} - -pipeline { - agent { - label 'maven-java-8' - } - environment { - GIT_NEXUS_ID = 'bitbucket-nexus-access' - GITHUB_CREDENTIAL_ID = 'github-api-key' - AKS_CRED_ID = 'aksCTPrdSrv' - } - options { - buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '0', daysToKeepStr: '', numToKeepStr: '10')) - disableConcurrentBuilds() - timeout(time: 60, unit: 'MINUTES') - } - parameters { - string(name: 'cause', defaultValue: 'manual', description: 'Who triggered this build?') - booleanParam(name: 'release', defaultValue: false, description: 'Should a release be performed?') - booleanParam(name: 'test', defaultValue: true, description: 'Should tests be performed?') - booleanParam(name: 'build', defaultValue: true, description: 'Should a full build/compress be performed?') - } - stages { - stage('Initialize'){ - steps { - echo "Pipeline triggered because ${params.cause}" - - echo "Cleanup workspace" - sh 'mvn clean -P release,compress,rollout' - - script{ - buildParams << params; - if (!buildParams.release){ - return; - } - def project = readMavenPom(); - def curversion = project.version.replace('-SNAPSHOT', '') - timeout(5) { - releaseParams = input message: "Choose Versions:", parameters: [ - string(defaultValue: "${curversion}", description: 'The current release version', name: 'RELEASE_VERSION'), - string(defaultValue: "${curversion}", description: 'The next target version', name: 'NEXT_DEV_VERSION_RAW')] - } - if (releaseParams['RELEASE_VERSION'] == releaseParams['NEXT_DEV_VERSION_RAW']){ - error "Release and new target version must be different!" - } - def rawDevVersion = releaseParams['NEXT_DEV_VERSION_RAW'] - rawDevVersion = rawDevVersion.replace('-SNAPSHOT', ''); - // Ensure that raw dev version has no snapshot post fix - releaseParams['NEXT_DEV_VERSION_RAW'] = rawDevVersion; - // ensure that next dev version has a snapshot post fix - releaseParams['NEXT_DEV_VERSION'] = rawDevVersion + "-SNAPSHOT"; - // update display name - currentBuild.displayName = "${currentBuild.displayName} RELEASE ${releaseParams['RELEASE_VERSION']}" - - echo "Update module versions ${releaseParams}" - withCredentials([usernamePassword(credentialsId: GITHUB_CREDENTIAL_ID, passwordVariable: 'GITHUB_USER_PW', usernameVariable: 'GITHUB_USER_NAME')]){ - updateVersions(releaseParams['RELEASE_VERSION'],false); - } - } - } - } - stage('Test'){ - when { expression { return buildParams.test && !buildParams.release} } - steps { - echo "run js tests" - sh "mvn prepare-package -P run-js-tests,include-mapapps-deps" - - script { - testStageWasExecute = true; - } - } - } - stage('Build') { - when { expression { return buildParams.build || buildParams.release } } - steps { - echo "full build + js compress + nexus deploy" - withCredentials([usernamePassword(credentialsId: GIT_NEXUS_ID, passwordVariable: 'USER_PW', usernameVariable: 'USER_NAME')]) { - sh 'mvn deploy -P compress -DdeployAtEnd=true -Dmaven.test.skip.exec=true -Dct-nexus.username=$USER_NAME -Dct-nexus.password=$USER_PW' - } - } - } - stage('Rollout') { - when { expression { return buildParams.release } } - steps { - echo "create rollout" - withCredentials([usernamePassword(credentialsId: GIT_NEXUS_ID, passwordVariable: 'USER_PW', usernameVariable: 'USER_NAME'), - usernamePassword(credentialsId: GITHUB_CREDENTIAL_ID, passwordVariable: 'GITHUB_USER_PW', usernameVariable: 'GITHUB_USER_NAME')]){ - sh "mvn deploy -P github-release -Dct-nexus.username=${USER_NAME} -Dct-nexus.password=${USER_PW} -Dusername=${GITHUB_USER_NAME} -Dpassword=${GITHUB_USER_PW}" - } - } - } - stage('Finalize') { - steps { - script { - if (!buildParams.release){ - return; - } - echo "Update versions after release" - withCredentials([usernamePassword(credentialsId: GITHUB_CREDENTIAL_ID, passwordVariable: 'GITHUB_USER_PW', usernameVariable: 'GITHUB_USER_NAME')]){ - updateVersions(releaseParams['NEXT_DEV_VERSION'],true); - } - } - } - post { - success{ - echo "Cleanup workspace after build" - sh 'mvn clean -P release,compress,rollout' - } - } - } - } -} diff --git a/RELEASE.md b/RELEASE.md index b14d54e..21716f2 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,4 @@ -✅ Tested for map.apps 4.18.1 / Linie 4 +✅ Tested for map.apps 4.18.3 / Linie 4 #### Release Notes - autogenerated SNAPSHOT-Release diff --git a/package.json b/package.json index 6c71dea..0f21b14 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "watch-types": "tsc -w --noEmit" }, "devDependencies": { - "@conterra/ct-mapapps-typings": "~4.18.1", + "@conterra/ct-mapapps-typings": "~4.18.3", "@conterra/mapapps-mocha-runner": "1.1.1", "@conterra/reactivity-core": "^0.4.0", "@types/chai": "4.3.10", @@ -17,7 +17,7 @@ "@types/mocha": "10.0.4", "arcgis-js-api": "4.29.10", "chai": "4.3.10", - "ct-mapapps-browser-sync": "0.0.39", + "ct-mapapps-browser-sync": "0.0.41", "ct-mapapps-gulp-js": "0.10.3", "eslint-config-ct-prodeng": "1.4.0", "license-checker": "25.0.1", diff --git a/pom.xml b/pom.xml index 5ad0dfb..247872c 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,10 @@ + de.conterra.mapapps - ct-mapapps + ct-mapapps-js-bom ${mapapps.version} pom import @@ -50,31 +51,12 @@ - + - org.vuejs - vue - dev - test - - - org.vuetifyjs - vuetify - dev - test - - - - - de.conterra.jsrt - ct-jsrt-test-intern - ${ct.jsrt-test.version} - test - - - de.conterra.jsrt - ct-jsrt-test-uitest - ${ct.jsrt-test.version} + de.conterra.mapapps + ct-mapapps-js-bom-dev-test + ${mapapps.version} + pom test @@ -277,7 +259,6 @@ org.vuetifyjs vuetify - ${vuetify.version} dev ${project.build.directory}/unpacked/layout vuetify/stylus/** @@ -293,6 +274,8 @@ ${project.build.directory}/bundle-imports + jar + true @@ -448,8 +431,7 @@ deployAppTemplate - - ${project.build.directory}/${project.artifactId}-sample-app.zip + ${project.build.directory}/${project.artifactId}-sample-app.zip ${js.build.outputPath}/apps/manager @@ -514,13 +496,12 @@ ${project.build.directory}/webapp ${root.build.outputPath}/js - 4.18.1 - 1.5.30 + 4.18.3 ${mapapps.version} + - 2.1.1 - 2.0.2 + 2.1.3 manager @@ -559,47 +540,9 @@ de.conterra.mapapps - ct-mapapps-js - test - - - org.dojotoolkit - dojo-release - test - - - org.dojotoolkit - dgrid - test - - - org.dojotoolkit - dstore - test - - - com.esri.js - ags-js-api4 - test - - - com.esri - terraformer-js - test - - - moment-js - moment-js - test - - - de.conterra.js - apprt-polyfill - test - - - de.conterra.js - reactivity + ct-mapapps-js-bom-dev + ${mapapps.version} + pom test diff --git a/src/support/js/check-licenses.ts b/src/support/js/check-licenses.ts new file mode 100644 index 0000000..9eda7f4 --- /dev/null +++ b/src/support/js/check-licenses.ts @@ -0,0 +1,59 @@ +/* + Checks licenses of node dependencies against a list of allowed licenses. + 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: + + $ 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: + + $ npm install -g license-checker + $ license-checker --summary # outputs list of used licenses + $ license-checker --json # outputs details + + See also https://www.npmjs.com/package/license-checker +*/ + +import { init as initChecker } from "license-checker"; +import { cwd, exit} from "node:process"; + +// Licenses known to be OK. +const ACCEPTED_LICENSES = [ + "MIT", + "ISC", + "Apache-2.0", + "Apache 2.0", + "BSD-2-Clause", + "BSD-3-Clause", + "BSD", + "CC0-1.0", + "CC-BY-3.0", + "CC-BY-4.0", + "Python-2.0", + "Unlicense" // Note: not unlicenseD (https://opensource.org/licenses/unlicense) +]; + +// Packages with licenses that are not recognized properly by license-checker. +// These must be checked manually. +const SKIP_PACKAGES = [ + "event-stream@3.0.20", // MIT License not recognized + "taffydb@2.6.2" // BSD-1-Clause License in source code +]; + +initChecker( + { + start: cwd(), + onlyAllow: ACCEPTED_LICENSES.join(";"), + excludePackages: SKIP_PACKAGES.join(";") + }, + (error, packages) => { + void packages; // currently unused + + if (error) { + console.error("Error: ", error); + exit(1); + } + exit(0); + } +); diff --git a/src/test/webapp/favicon.ico b/src/test/webapp/favicon.ico deleted file mode 100644 index 9728155..0000000 Binary files a/src/test/webapp/favicon.ico and /dev/null differ diff --git a/tsconfig.json b/tsconfig.json index ff7e3ae..e8100df 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,5 +15,5 @@ "skipLibCheck": true, "esModuleInterop": true }, - "include": ["src"] + "include": ["src", "node_modules/arcgis-js-api/index.d.ts"] }