Skip to content

Commit

Permalink
Update project to mapapps 4.17
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasstein committed May 26, 2024
1 parent e60a2bc commit 1af6250
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 71 deletions.
8 changes: 8 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
"type": "shell",
"command": "mvn clean",
"group": "build"
},
{
"label": "Watch types",
"detail": "Start TypeScript compiler in watch mode",
"type": "npm",
"script": "watch-types",
"group": "build",
"problemMatcher": [],
}
]
}
7 changes: 2 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -139,7 +137,6 @@ gulp.task("lint",
gulp.task("preview",
gulp.series(
"build",
"lint",
gulp.parallel(
"watch",
"browser-sync"
Expand Down
40 changes: 25 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,32 @@
"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.17.0",
"@conterra/mapapps-mocha-runner": "1.1.1",
"@types/arcgis-js-api": "4.28.0",
"@types/chai": "4.3.10",
"@types/license-checker": "^25.0.6",
"@types/mocha": "10.0.4",
"chai": "4.3.10",
"ct-mapapps-browser-sync": "0.0.35",
"ct-mapapps-gulp-js": "0.10.2",
"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.2.2",
"vue": "2.7.15",
"vue-template-compiler": "2.7.15"
}
}
61 changes: 27 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>de.conterra.mapapps</groupId>
<artifactId>ct-mapapps-js</artifactId>
<version>${mapapps.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -97,6 +92,11 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>de.conterra.mapapps</groupId>
<artifactId>mapapps-maven-plugin</artifactId>
<version>${mapapps.version}</version>
</plugin>
<plugin>
<groupId>de.conterra.jsregistry</groupId>
<artifactId>ct-jsregistry-maven-plugin</artifactId>
Expand Down Expand Up @@ -149,10 +149,9 @@
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<version>1.14.2</version>
<configuration>
<nodeVersion>v18.13.0</nodeVersion>
<npmVersion>8.19.3</npmVersion>
<nodeVersion>v20.9.0</nodeVersion>
</configuration>
</plugin>
<plugin>
Expand All @@ -178,11 +177,6 @@
<artifactId>setproperties-maven-plugin</artifactId>
<version>1.0.2</version>
</plugin>
<plugin>
<groupId>de.conterra.jsrt</groupId>
<artifactId>ct-jsrt-test-maven-plugin</artifactId>
<version>${ct.jsrt-test.version}</version>
</plugin>
</plugins>
</pluginManagement>
<sourceDirectory>src/main/js</sourceDirectory>
Expand Down Expand Up @@ -220,32 +214,31 @@
</execution>
</executions>
<configuration>
<!-- add here properties which are used in plugin configuration resolution -->
<properties>
<!-- deployment of map.apps installation -->
<mapapps.remote.base>.</mapapps.remote.base>
</properties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<version>3.11.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<version>3.5.0</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>unpack-themes-src</id>
Expand Down Expand Up @@ -348,6 +341,9 @@
<include>**/gulpfile.js</include>
<include>**/pom.xml</include>
</includes>
<excludes>
<exclude>src/main/js/**/*.min.js</exclude>
</excludes>
<mapping>
<vue>XML_STYLE</vue>
</mapping>
Expand Down Expand Up @@ -414,6 +410,12 @@
<plugin>
<groupId>de.conterra.mapapps</groupId>
<artifactId>mapapps-maven-plugin</artifactId>
<configuration>
<!-- only build zip files -->
<skipDeploy>true</skipDeploy>
<sourceDirectory>${js.build.outputPath}/apps</sourceDirectory>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
<executions>
<execution>
<!-- used to create .zip files containing the apps during the build -->
Expand Down Expand Up @@ -441,13 +443,6 @@
</configuration>
</execution>
</executions>
<configuration>
<!-- only build zip files -->
<skipDeploy>true</skipDeploy>
<createApp>false</createApp>
<sourceDirectory>${js.build.outputPath}/apps</sourceDirectory>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand Down Expand Up @@ -501,11 +496,12 @@
<root.build.outputPath>${project.build.directory}/webapp</root.build.outputPath>
<js.build.outputPath>${root.build.outputPath}/js</js.build.outputPath>

<mapapps.version>4.15.1</mapapps.version>
<mapapps.version>4.17.0</mapapps.version>
<vuetify.version>1.5.28</vuetify.version>
<!-- JS lib versions -->
<apprt.version>${mapapps.version}</apprt.version>
<!-- java lib versions -->
<ct.jsregistry.version>1.5.10</ct.jsregistry.version>
<ct.jsregistry.version>2.0.1</ct.jsregistry.version>
<ct.jsrt-test.version>2.0.2</ct.jsrt-test.version>

<!-- the default app, replaced in the *.html files to switch app names-->
Expand Down Expand Up @@ -568,6 +564,11 @@
<artifactId>ags-js-api4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.esri</groupId>
<artifactId>terraformer-js</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>moment-js</groupId>
<artifactId>moment-js</artifactId>
Expand Down Expand Up @@ -670,12 +671,6 @@
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
<plugin>
<groupId>de.conterra.jsregistry</groupId>
<artifactId>ct-jsregistry-maven-plugin</artifactId>
Expand Down Expand Up @@ -718,8 +713,6 @@
<configuration>
<skipDeploy>${skip.apps.upload}</skipDeploy>
<deployAsApp>true</deployAsApp>
<appName>${project.artifactId}</appName>
<appTitle>${project.artifactId}-${project.version}</appTitle>
<appEditorState>PUBLISHED</appEditorState>
<serverResourcesEndpoint>${mapapps.remote.base}/resources</serverResourcesEndpoint>
<username>${mapapps.user}</username>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 = [
Expand All @@ -41,17 +41,19 @@ const SKIP_PACKAGES = [
"[email protected]" // 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);
}
);
6 changes: 3 additions & 3 deletions src/test/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
version="3.0">

<display-name>map.apps sample</display-name>

<!-- NOTE: a META-INF/web-fragment.xml from ct-jsregistry-embedded is also loaded together with this specification ! -->

<servlet>
Expand All @@ -18,7 +18,7 @@
<servlet-name>ProxyServlet</servlet-name>
<url-pattern>/proxy</url-pattern>
</servlet-mapping>

<servlet>
<!-- Override init parameter to avoid nasty -->
<!-- file locking issue on windows.
Expand All @@ -30,5 +30,5 @@
<param-value>false</param-value>
</init-param>
</servlet>

</web-app>
12 changes: 6 additions & 6 deletions src/test/webapp/js/tests/test-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/test/webapp/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@
.dj_ie .start.notheme .dijitInputInner,
.dj_gecko .start.notheme .dijitInputInner{
height: 22px;
}
}

0 comments on commit 1af6250

Please sign in to comment.