Skip to content

Commit

Permalink
Merge pull request #3740 from MV88/align_master_09-05-19
Browse files Browse the repository at this point in the history
Align master 09 05 19 over c125_annotations
  • Loading branch information
Tobia Di Pisa authored May 14, 2019
2 parents 7e4d1a1 + 744ad3b commit ddfd534
Show file tree
Hide file tree
Showing 150 changed files with 4,724 additions and 863 deletions.
3 changes: 0 additions & 3 deletions .doclets.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A few sentences describing the overall goals of the pull request' s commits.

**Does this PR introduce a breaking change?** (check one with "x", remove the other)

- [ ] Yes
- [ ] Yes, and I documented them in migration notes
- [ ] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Expand Down
2 changes: 0 additions & 2 deletions .github_changelog_generator

This file was deleted.

32 changes: 28 additions & 4 deletions buildConfig.js → build/buildConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,30 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path');
const ParallelUglifyPlugin = require("webpack-parallel-uglify-plugin");

module.exports = (bundles, themeEntries, paths, extractThemesPlugin, prod, publicPath, cssPrefix, chunks) => ({
/**
* Webpack configuration builder.
* Returns a webpack configuration object for the given parameters.
*
* @param {object} bundles object that defines the javascript (or jsx) entry points and related bundles
* to be built (bundle name -> entry point path)
* @param {object} themeEntries object that defines the css (or less) entry points and related bundles
* to be built (bundle name -> entry point path)
* @param {object} paths object with paths used by the configuration builder:
* - dist: path to the output folder for the bundles
* - base: root folder of the project
* - framework: root folder of the MapStore2 framework
* - code: root folder(s) for javascript / jsx code, can be an array with several folders (e.g. framework code and
* project code)
* @param {object} extractThemesPlugin plugin to be used for bundling css (usually defined in themes.js)
* @param {boolean} prod flag for production / development mode (true = production)
* @param {string} publicPath web public path for loading bundles (e.g. dist/)
* @param {string} cssPrefix prefix to be appended on every generated css rule (e.g. ms2)
* @param {array} prodPlugins plugins to be used only in production mode
* @param {object} alias aliases to be used by webpack to resolve paths (alias -> real path)
* @param {object} proxy webpack-devserver custom proxy configuration object
* @returns a webpack configuration object
*/
module.exports = (bundles, themeEntries, paths, extractThemesPlugin, prod, publicPath, cssPrefix, prodPlugins, alias = {}, proxy) => ({
entry: assign({
'webpack-dev-server': 'webpack-dev-server/client?http://0.0.0.0:8081', // WebpackDevServer host and port
'webpack': 'webpack/hot/only-dev-server' // "only" prevents reload on syntax errors
Expand Down Expand Up @@ -49,15 +72,16 @@ module.exports = (bundles, themeEntries, paths, extractThemesPlugin, prod, publi
new NormalModuleReplacementPlugin(/proj4$/, path.join(paths.framework, "libs", "proj4")),
new NoEmitOnErrorsPlugin(),
extractThemesPlugin
].concat(prod && chunks || []).concat(prod ? [new ParallelUglifyPlugin({
].concat(prod && prodPlugins || []).concat(prod ? [new ParallelUglifyPlugin({
uglifyJS: {
sourceMap: false,
compress: {warnings: false},
mangle: true
}
})] : []),
resolve: {
extensions: [".js", ".jsx"]
extensions: [".js", ".jsx"],
alias: alias
},
module: {
noParse: [/html2canvas/],
Expand Down Expand Up @@ -139,7 +163,7 @@ module.exports = (bundles, themeEntries, paths, extractThemesPlugin, prod, publi
}] : [])
},
devServer: {
proxy: {
proxy: proxy || {
'/rest/geostore': {
target: "https://dev.mapstore.geo-solutions.it/mapstore",
secure: false,
Expand Down
1 change: 1 addition & 0 deletions docma-config.json → build/docma-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@

"web/client/utils/index.jsdoc",
"web/client/utils/CoordinatesUtils.js",
"web/client/utils/ImmutableUtils.js",
"web/client/utils/LocaleUtils.js",
"web/client/utils/PluginsUtils.js",
"web/client/utils/PrintUtils.js",
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions build/examples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var path = require("path");

module.exports = {
mouseposition: path.join(__dirname, "..", "web", "client", "examples", "mouseposition", "app"),
scalebar: path.join(__dirname, "..", "web", "client", "examples", "scalebar", "app"),
// layertree: path.join(__dirname, "web", "client", "examples", "layertree", "app"),
"3dviewer": path.join(__dirname, "..", "web", "client", "examples", "3dviewer", "app"),
// queryform: path.join(__dirname, "web", "client", "examples", "queryform", "app"),
featuregrid: path.join(__dirname, "..", "web", "client", "examples", "featuregrid", "app"),
print: path.join(__dirname, "..", "web", "client", "examples", "print", "app"),
login: path.join(__dirname, "..", "web", "client", "examples", "login", "app"),
plugins: path.join(__dirname, "..", "web", "client", "examples", "plugins", "app"),
// rasterstyler: path.join(__dirname, "web", "client", "examples", "rasterstyler", "app"),
api: path.join(__dirname, "..", "web", "client", "examples", "api", "app")
// this example is not linked and seems to cause a big slow down with uglyfyplugin. disabled temporary
// styler: path.join(__dirname, "web", "client", "examples", "styler", "app")
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ const path = require("path");
module.exports = function karmaConfig(config) {
config.set(require('./testConfig')({
files: [
'web/client/libs/Cesium/Build/Cesium/Cesium.js',
'tests.webpack.js',
'./web/client/libs/Cesium/Build/Cesium/Cesium.js',
'build/tests.webpack.js',
{ pattern: './web/client/test-resources/**/*', included: false },
{ pattern: './web/client/translations/**/*', included: false }
],
path: path.join(__dirname, "web", "client"),
testFile: 'tests.webpack.js',
basePath: "..",
path: path.join(__dirname, "..", "web", "client"),
testFile: 'build/tests.webpack.js',
singleRun: false
}));
};
7 changes: 4 additions & 3 deletions karma.conf.single-run.js → build/karma.conf.single-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ const path = require("path");
module.exports = function karmaConfig(config) {
const testConfig = require('./testConfig')({
files: [
'tests-travis.webpack.js',
'build/tests-travis.webpack.js',
{ pattern: './web/client/test-resources/**/*', included: false },
{ pattern: './web/client/translations/**/*', included: false }
],
path: path.join(__dirname, "web", "client"),
testFile: 'tests-travis.webpack.js',
path: path.join(__dirname, "..", "web", "client"),
basePath: "..",
testFile: 'build/tests-travis.webpack.js',
singleRun: true
});
testConfig.webpack.module.rules = [{
Expand Down
14 changes: 7 additions & 7 deletions prod-webpack.config.js → build/prod-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ const extractThemesPlugin = require('./themes.js').extractThemesPlugin;
const HtmlWebpackPlugin = require('html-webpack-plugin');

const paths = {
base: __dirname,
dist: path.join(__dirname, "web", "client", "dist"),
framework: path.join(__dirname, "web", "client"),
code: path.join(__dirname, "web", "client")
base: path.join(__dirname, ".."),
dist: path.join(__dirname, "..", "web", "client", "dist"),
framework: path.join(__dirname, "..", "web", "client"),
code: path.join(__dirname, "..", "web", "client")
};

module.exports = require('./buildConfig')(
assign({
"mapstore2": path.join(__dirname, "web", "client", "product", "app"),
"embedded": path.join(__dirname, "web", "client", "product", "embedded"),
"ms2-api": path.join(__dirname, "web", "client", "product", "api")
"mapstore2": path.join(paths.code, "product", "app"),
"embedded": path.join(paths.code, "product", "embedded"),
"ms2-api": path.join(paths.code, "product", "api")
},
require('./examples')
),
Expand Down
7 changes: 5 additions & 2 deletions testConfig.js → build/testConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = ({files, path, testFile, singleRun}) => ({
module.exports = ({files, path, testFile, singleRun, basePath = ".", alias = {}}) => ({
browsers: [ 'Chrome' ],

browserNoActivityTimeout: 30000,
Expand All @@ -9,6 +9,8 @@ module.exports = ({files, path, testFile, singleRun}) => ({

frameworks: [ 'mocha' ],

basePath,

files,

preprocessors: {
Expand Down Expand Up @@ -98,7 +100,8 @@ module.exports = ({files, path, testFile, singleRun}) => ({
]
},
resolve: {
extensions: ['.js', '.json', '.jsx']
extensions: ['.js', '.json', '.jsx'],
alias: alias
}
},
webpackServer: {
Expand Down
3 changes: 3 additions & 0 deletions build/tests-travis.webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var context = require.context('../web', true, /-test\.jsx?$/);
context.keys().forEach(context);
module.exports = context;
3 changes: 3 additions & 0 deletions build/tests.webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var context = require.context('../web', true, /(-test\.jsx?)|(-test-chrome\.jsx?)$/);
context.keys().forEach(context);
module.exports = context;
4 changes: 2 additions & 2 deletions themes.js → build/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ const extractThemesPlugin = new ExtractTextPlugin({


const themeEntries = (() => {
const globPath = path.join(__dirname, "web", "client", "themes", "*");
const globPath = path.join(__dirname, "..", "web", "client", "themes", "*");
var files = glob.sync(globPath, {mark: true});
return files.filter((f) => f.lastIndexOf('/') === f.length - 1).reduce((res, curr) => {
var finalRes = res || {};
finalRes["themes/" + path.basename(curr, path.extname(curr))] = path.join(__dirname, "web", "client", "themes", `${path.basename(curr, path.extname(curr))}`, "theme.less");
finalRes["themes/" + path.basename(curr, path.extname(curr))] = path.join(__dirname, "..", "web", "client", "themes", `${path.basename(curr, path.extname(curr))}`, "theme.less");
return finalRes;
}, {});

Expand Down
22 changes: 22 additions & 0 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const path = require("path");

const themeEntries = require('./themes.js').themeEntries;
const extractThemesPlugin = require('./themes.js').extractThemesPlugin;

module.exports = require('./buildConfig')(
{
"mapstore2": path.join(__dirname, "..", "web", "client", "product", "app"),
"embedded": path.join(__dirname, "..", "web", "client", "product", "embedded"),
"ms2-api": path.join(__dirname, "..", "web", "client", "product", "api")
},
themeEntries,
{
base: path.join(__dirname, ".."),
dist: path.join(__dirname, "..", "web", "client", "dist"),
framework: path.join(__dirname, "..", "web", "client"),
code: path.join(__dirname, "..", "web", "client")
},
extractThemesPlugin,
false,
"dist/"
);
Loading

0 comments on commit ddfd534

Please sign in to comment.