Skip to content

Commit

Permalink
DN-34: Updated to map.apps 4.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Bröker committed Jun 12, 2024
1 parent a6f28db commit a950e16
Show file tree
Hide file tree
Showing 35 changed files with 971 additions and 709 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "eslint-config-ct-prodeng",
"plugins": [
"vue"
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
/.vscode/settings.json
/.externalToolBuilders/
/package-lock.json
/gulpfile.overrides.js
3 changes: 3 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# add path patterns to ignore style files
**/external-libs/**
**/styles/dijit/**
3 changes: 3 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-ct-prodeng"
}
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -199,3 +199,4 @@
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.

25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ https://demos.conterra.de/mapapps/resources/apps/downloads_imprintprivacy/index.
}
```

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:
`<mapapps.remote.base>http://%YOURSERVER%/ct-mapapps-webapp-%VERSION%</mapapps.remote.base>`
## 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:

##### Other methods to to define the mapapps.remote.base property.
1. Goal parameters
`mvn install -Dmapapps.remote.base=http://%YOURSERVER%/ct-mapapps-webapp-%VERSION%`
```bash
# install all required node modules
$ mvn initialize

2. Build properties
Change the mapapps.remote.base in the build.properties file and run:
`mvn install -Denv=dev -Dlocal.configfile=%ABSOLUTEPATHTOPROJECTROOT%/build.properties`
# start dev server
$ mvn compile -Denv=dev -Pinclude-mapapps-deps

# run unit tests
$ mvn test -P run-js-tests,include-mapapps-deps
```
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
✅ Tested for map.apps 4.18.1 / Linie 4

#### Release Notes
- autogenerated SNAPSHOT-Release
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2020 con terra GmbH (info@conterra.de)
# 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.
Expand All @@ -15,4 +15,4 @@
#

# URL to the remote map.apps instance
mapapps.remote.base=http://%YOURSERVER%/ct-mapapps-webapp-%VERSION%
# mapapps.remote.base=http://%YOURSERVER%/ct-mapapps-webapp-%VERSION%
159 changes: 149 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 con terra GmbH (info@conterra.de)
* 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.
Expand All @@ -15,26 +15,165 @@
*/
const gulp = require("gulp");
const mapapps = require('ct-mapapps-gulp-js');
const mapappsBrowserSync = require("ct-mapapps-browser-sync");

const isProduction = process.env.NODE_ENV === "production";
console.info(`Configuring gulp build for ${isProduction ? "production" : "development"}`);

const localOverrides = (function () {
if (isProduction) {
// Never override defaults in production mode
return undefined;
}

try {
return require("./gulpfile.overrides");
} catch (e) {
// File may not exist
return undefined;
}
})();

// used to transport test urls in "run-browser-tests-local" task
const runBrowserTests = [];

mapapps.registerTasks({
/** Enable debug logging */
debug: localOverrides?.debug ?? false,
/** enable linting */
lintOnWatch: localOverrides?.lintOnWatch ?? true,
/** enable es6 by default */
forceTranspile: true,
/* A detailed description of available setting is available at https://www.npmjs.com/package/ct-mapapps-gulp-js */
compress: isProduction,

/* build source maps as e.g. ".js.map" */
sourceMaps: "file",

/** Build Unit-Tests only in dev mode */
rollupBuildTests: !isProduction,
/** Amount of Threads used to build the bundles, if there are only a few bundles 1 is ok.
* More as 3 is normally not required.
*/
rollupBuildMaxWorkers: localOverrides?.rollupBuildMaxWorkers ?? 1,

/** List of build time flags, usage like: import { debug } from "build-config!".
*/
rollupConfig: {
debug: !isProduction
},

/* 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 the vuetify core styles*/
/* state that we want to support vuetify components and therefore need the vuetify core styles*/
hasVuetify: true,
/*themeChangeTargets: {
"vuetify": [
"sample_theme"
themeChangeTargets: {
"vuetify": []
},
/* A list oft target browser versions. This should be streamlined with Esri JS API requirements. */
transpileTargets: {
firefox: 102,
edge: 104,
chrome: 104,
safari: 15
},
runBrowserTests,
watchFinishedReceiver() {
if (localOverrides?.autoReload ?? true) {
mapappsBrowserSync.state.reload();
}
}
}, gulp);

mapappsBrowserSync.registerTask({
// on which port to listen
port: localOverrides?.port ?? 9090,
// activate https protocol, generates a self signed certificate for "localhost"
// https://browsersync.io/docs/options#option-https
https: localOverrides?.https ?? false,

// 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: [
"mocha",
"chai",
"@conterra/mapapps-mocha-runner"
]
},
// prevent reload by browser sync (reload triggered on watch end)
externalReloadTrigger: true
}, gulp);

gulp.task("default",
gulp.task("build",
gulp.series(
"copy-resources",
"themes-copy",
gulp.parallel("js-transpile", "themes-compile")
gulp.parallel(
"js-transpile",
"rollup-build",
"themes-compile"
)
)
);

gulp.task("lint",
gulp.parallel(
"js-lint"
/*, comment in to lint .css/.less files
"style-lint"
*/
));

gulp.task("preview",
gulp.series(
"build",
gulp.parallel(
"watch",
"browser-sync"
)
));

gulp.task("run-tests",
gulp.series(
"browser-sync-start",
function transportTestUrls() {
// transport test url to run-browser-tests
// eslint-disable-next-line max-len
const testsAt = mapappsBrowserSync.state.url + "/resources/jsregistry/root/@conterra/mapapps-mocha-runner/latest/mocha.html?boot=/js/tests/test-init.js&timeout=5000&test=dn_imprintprivacy/tests/all&reporter=tap";
runBrowserTests.push(testsAt);
return Promise.resolve();
},
"run-browser-tests",
"browser-sync-stop"
));

gulp.task("test",
gulp.series(
"build",
"lint",
"run-tests"
));

gulp.task("compress",
gulp.series(
"build",
"themes-compress",
"lint"
)
);

gulp.task("default",
gulp.series(
"build",
"lint"
));
34 changes: 30 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
{
"name": "test",
"name": "mapapps-4-developers",
"description": "test build",
"version": "0.0.1",
"license": "CC0-1.0",
"scripts": {
"check-licenses": "tsx ./src/support/js/check-licenses.ts",
"check-types": "tsc --noEmit",
"watch-types": "tsc -w --noEmit"
},
"devDependencies": {
"ct-mapapps-gulp-js": "^0.3.6",
"vue-template-compiler": "2.6.6",
"@types/arcgis-js-api": "4.13.0"
"@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"
}
}
Loading

0 comments on commit a950e16

Please sign in to comment.