From f8db8b505cb79b83623fe30c873cb319da3c95cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 20 Sep 2024 09:09:58 +0200 Subject: [PATCH 1/5] Clean package --- .npmignore | 7 ++++++ package.json | 6 ++--- utils/ios-overlap-fix.js | 53 ---------------------------------------- 3 files changed, 10 insertions(+), 56 deletions(-) delete mode 100644 utils/ios-overlap-fix.js diff --git a/.npmignore b/.npmignore index c3ac9d7b907e..f8b938fce6f2 100644 --- a/.npmignore +++ b/.npmignore @@ -24,3 +24,10 @@ /cypress **.spec.ts /tsconfig*.json +/apidocs +/cypress.config.ts +/eslint.config.mjs +/locales/ +/svgo.js +/typedoc.json +/webpack.config.js diff --git a/package.json b/package.json index cc26dd47c630..58de084bc4ca 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "prepare": "tsc --pretty", "typecheck": "tsc --project tsconfig-all.json --noEmit", "doc": "typedoc", - "build-storybook": "NODE_ENV=env TARGET=ngeo-examples storybook build --output-dir=.build/storybook", - "storybook": "NODE_ENV=env TARGET=ngeo-examples storybook dev --port=6006", - "storybook-ci": "NODE_ENV=env TARGET=ngeo-examples storybook dev --port=6006 --ci", + "build-storybook": "TARGET=ngeo-examples storybook build --output-dir=.build/storybook", + "storybook": "TARGET=ngeo-examples storybook dev --port=6006", + "storybook-ci": "TARGET=ngeo-examples storybook dev --port=6006 --ci", "cypress-cli": "cypress run --headless", "cypress-ui": "cypress open --e2e", "test-cli": "start-server-and-test storybook-ci http://localhost:6006 cypress-cli", diff --git a/utils/ios-overlap-fix.js b/utils/ios-overlap-fix.js deleted file mode 100644 index bdc781a2aafa..000000000000 --- a/utils/ios-overlap-fix.js +++ /dev/null @@ -1,53 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2017-2024 Camptocamp SA -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -(function () { - // Hack for ios Safari browser (UI overlapping on iOS 10) - let userAgent = window.navigator.userAgent; - let regEx = /(iPhone|iPod|iPad)/; - let iOS = regEx.test(userAgent); - let webkit = /WebKit/i.test(userAgent); - let chromeiOS = /(Chrome|CriOS|OPiOS)/i.test(userAgent); - let platform = regEx.test(window.navigator.platform); - - let iosChecker = function () { - let v = /OS (\d+)_(\d+)_?(\d+)?/.exec(window.navigator.appVersion); - return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)]; - }; - - /** - * iOS is true on iOS or emulators (user-agent) - * webkit is true on Safari/Chrome, etc - * platform is true on iOS, not emulator (platform) - * chromeiOS is true on other browsers (chrome/opera) - */ - if (iOS && webkit && platform && !chromeiOS) { - let iosVersion = iosChecker()[0]; - if (iosVersion >= 10) { - const interval = setInterval(function () { - if ($('div.ol-zoom').get(0)) { - clearInterval(interval); - $('body').addClass('ios-margin'); - } - }, 100); - } - } -})(); From 38ef384c01058498c15b243840ef35f6d6564986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 20 Sep 2024 09:12:05 +0200 Subject: [PATCH 2/5] Cleanup package prepare, add SASS files into distlib --- .github/workflows/main.yaml | 6 ------ package.json | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a7c27b6aeaf7..f04df34a3bd1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -164,12 +164,6 @@ jobs: - run: npm run doc -- srcapi/store/config.ts --json dist/typedoc.json - run: npm run doc - run: npm run build-api - env: - NODE_OPTIONS: --openssl-legacy-provider - - run: npm run dist - env: - NODE_OPTIONS: --openssl-legacy-provider - - run: npm run dist-spinner - uses: actions/upload-artifact@v4 with: diff --git a/package.json b/package.json index 58de084bc4ca..8a08c8ab3533 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,12 @@ "serve-gmf-examples": "DEV_SERVER=1 TARGET=gmf-examples webpack serve --open --server-type=https --server-options-cert=private.crt --server-options-key=private.key --port=3000 --mode=development --progress --watch", "serve-gmf-apps": "DEV_SERVER=1 TARGET=gmf-apps webpack serve --open --server-type=https --server-options-cert=private.crt --server-options-key=private.key --port=3000 --mode=development --progress", "serve-api": "webpack serve --content-base=api/dist/apihelp/ --config=buildtools/webpack.api.js --server-type=https --server-options-cert=private.crt --server-options-key=private.key --port=3000 --mode=development --progress --watch", + "build-gmf-apps-profile": "TARGET=gmf-apps webpack --profile --json > profile.json", "dist": "TARGET=dist webpack --mode=production --progress", "dist-spinner": "svgo --config=svgo.js src/icons/spinner.svg --output=dist/spinner.svg", - "build-gmf-apps-profile": "TARGET=gmf-apps webpack --profile --json > profile.json", - "prepare": "tsc --pretty", + "distlib": "tsc --pretty", + "distlib-scss": "copyfiles src/**.scss distlib", + "prepare": "npm run dist && npm run dist-spinner && npm run distlib && npm run distlib-scss", "typecheck": "tsc --project tsconfig-all.json --noEmit", "doc": "typedoc", "build-storybook": "TARGET=ngeo-examples storybook build --output-dir=.build/storybook", @@ -154,6 +156,7 @@ "chromatic": "11.7.1", "commander": "12.1.0", "copy-webpack-plugin": "12.0.2", + "copyfiles": "2.4.1", "css-loader": "7.1.2", "cy-mobile-commands": "0.3.0", "cypress": "13.14.1", From ce95903bf80429b7a7584fa7e5e4cc5cce5c67b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 20 Sep 2024 09:24:08 +0200 Subject: [PATCH 3/5] Add missing CSS in dist folder --- buildtools/webpack.commons.js | 9 ++- buildtools/webpack.dist.js | 26 +++++-- buildtools/webpack.prod.js | 2 +- package-lock.json | 141 ++++++++++++++++++++++++++-------- package.json | 2 +- 5 files changed, 139 insertions(+), 41 deletions(-) diff --git a/buildtools/webpack.commons.js b/buildtools/webpack.commons.js index 90a625733447..d9f656e5d710 100644 --- a/buildtools/webpack.commons.js +++ b/buildtools/webpack.commons.js @@ -21,7 +21,7 @@ const path = require('path'); const webpack = require('webpack'); -const {PromiseTask} = require('event-hooks-webpack-plugin/lib/tasks'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const devMode = process.env.NODE_ENV !== 'production'; @@ -85,13 +85,13 @@ module.exports = function (config) { rules.push({ test: /\.css$/, - use: [{loader: 'style-loader'}, {loader: 'css-loader'}], + use: [{loader: MiniCssExtractPlugin.loader}, {loader: 'css-loader'}], }); rules.push({ test: /\.s[ac]ss$/i, use: [ - {loader: 'style-loader'}, + {loader: MiniCssExtractPlugin.loader}, {loader: 'css-loader'}, {loader: 'sass-loader', options: {warnRuleAsWarning: false}}, ], @@ -141,6 +141,9 @@ module.exports = function (config) { resourceRegExp: /^\.\/locale$/, contextRegExp: /node_modules\/moment\/src\/lib\/locale$/, }), + new MiniCssExtractPlugin({ + filename: '[name]-[contenthash:6].css', + }), ]; if (config.nodll != true) { plugins.push(dllPlugin); diff --git a/buildtools/webpack.dist.js b/buildtools/webpack.dist.js index 5e4f31419f91..d50a00994941 100644 --- a/buildtools/webpack.dist.js +++ b/buildtools/webpack.dist.js @@ -19,10 +19,26 @@ // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +const path = require('path'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); + +const plugins = []; +const entry = {}; + +for (const name of ['desktop', 'mobile', 'iframe_api']) { + const folder = `contribs/gmf/apps/${name}`; + entry[name] = `./${folder}/Controller.js`; + plugins.push( + new HtmlWebpackPlugin({ + template: `${folder}/index.html.ejs`, + inject: false, + filename: `${name}.html`, + chunks: [name], + }), + ); +} + module.exports = { - entry: { - desktop: './contribs/gmf/apps/desktop_alt/Controller.js', - mobile: './contribs/gmf/apps/mobile_alt/Controller.js', - iframe_api: './contribs/gmf/apps/iframe_api/Controller.js', - }, + entry: entry, + plugins: plugins, }; diff --git a/buildtools/webpack.prod.js b/buildtools/webpack.prod.js index e10c120ab1a9..e2cfd2224ece 100644 --- a/buildtools/webpack.prod.js +++ b/buildtools/webpack.prod.js @@ -27,7 +27,7 @@ module.exports = function () { mode: 'production', devtool: 'source-map', output: { - filename: '[name].[chunkhash:6].js', + filename: '[name]-[chunkhash:6].js', assetModuleFilename: '[name]-[contenthash:6][ext]', }, plugins: [new webpack.optimize.ModuleConcatenationPlugin()], diff --git a/package-lock.json b/package-lock.json index 657a78224fc9..dbae017ed0b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@fortawesome/fontawesome-free": "5.15.4", - "@lit/reactive-element": "2.0.4", + "@sentry/browser": "8.29.0", "@trevoreyre/autocomplete-js": "3.0.2", "angular": "1.8.3", "angular-animate": "1.8.3", @@ -58,8 +58,6 @@ "@chromatic-com/storybook": "2.0.0", "@eslint/eslintrc": "3.1.0", "@eslint/js": "9.9.1", - "@popperjs/core": "2.11.8", - "@sentry/browser": "8.29.0", "@sentry/types": "8.29.0", "@storybook/addon-essentials": "8.2.9", "@storybook/addon-links": "8.2.9", @@ -96,17 +94,16 @@ "@typescript-eslint/eslint-plugin": "8.3.0", "@typescript-eslint/parser": "8.3.0", "angular-mocks": "1.8.3", - "chokidar": "3.6.0", "chromatic": "11.7.1", "commander": "12.1.0", "copy-webpack-plugin": "12.0.2", + "copyfiles": "2.4.1", "css-loader": "7.1.2", "cy-mobile-commands": "0.3.0", "cypress": "13.14.1", "cypress-browser-permissions": "1.1.0", "cypress-real-events": "1.13.0", "doctrine": "3.0.0", - "editorconfig-checker": "5.1.8", "ejs-loader": "0.5.0", "eslint": "9.9.1", "eslint-plugin-jsdoc": "50.2.2", @@ -131,6 +128,7 @@ "karma-webpack": "5.0.1", "loader-utils": "3.3.1", "magic-comments-loader": "2.1.3", + "mini-css-extract-plugin": "2.9.1", "minify-html-literals-loader": "1.1.1", "neat-csv": "6.0.1", "parse-absolute-css-unit": "1.0.2", @@ -142,7 +140,6 @@ "start-server-and-test": "2.0.5", "storybook": "8.2.9", "strip-bom": "5.0.0", - "style-loader": "4.0.0", "svgo": "3.3.2", "svgo-loader": "4.0.0", "terser": "5.31.6", @@ -3337,7 +3334,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.29.0.tgz", "integrity": "sha512-6HpyQkaqPvK6Lnigjlarq/LDYgXT2OBNf24RK7z0ipJSxSIpmtelfzHbnwWYnypNDXfTDdPm97fZEenQHryYJA==", - "dev": true, "dependencies": { "@sentry/core": "8.29.0", "@sentry/types": "8.29.0", @@ -3351,7 +3347,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.29.0.tgz", "integrity": "sha512-yAL5YMEFk4XaeVRUGEguydahRzaQrNPAaWRv6k+XRzCv9CGBhxb14KXQc9X/penlauMFcDfgelCPKcTqcf6wDw==", - "dev": true, "dependencies": { "@sentry/core": "8.29.0", "@sentry/types": "8.29.0", @@ -3365,7 +3360,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.29.0.tgz", "integrity": "sha512-Xgv/eYucsm7GaGKms2ClQ02NpD07MxjoTjp1/vYZm0H4Q08dVphVZrQp7hL1oX/VD9mb5SFyyKuuIRqIu7S8RA==", - "dev": true, "dependencies": { "@sentry-internal/browser-utils": "8.29.0", "@sentry/core": "8.29.0", @@ -3380,7 +3374,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.29.0.tgz", "integrity": "sha512-W2YbZRvp2lYC50V51fNLcnoIiK1Km4vSc+v6SL7c//lv2qpyumoUAAIDKY+14s8Lgt1RsR6rfZhfheD4O/6WSQ==", - "dev": true, "dependencies": { "@sentry-internal/replay": "8.29.0", "@sentry/core": "8.29.0", @@ -3395,7 +3388,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.29.0.tgz", "integrity": "sha512-aKTy4H/3RI0q9LIeepesjWGlGNeh4HGFfwQjzHME8gcWCQ5LSlzYX4U+hu2yp7r1Jfd9MUTFfOuuLih2HGLGsQ==", - "dev": true, "dependencies": { "@sentry-internal/browser-utils": "8.29.0", "@sentry-internal/feedback": "8.29.0", @@ -3413,7 +3405,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.29.0.tgz", "integrity": "sha512-scMbZaJ0Ov8NPgWn86EdjhyTLrhvRVbTxjg0imJAvhIvRbblH3xyqye/17Qnk2fOp8TNDOl7TBZHi0NCFQ5HUw==", - "dev": true, "dependencies": { "@sentry/types": "8.29.0", "@sentry/utils": "8.29.0" @@ -3426,7 +3417,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.29.0.tgz", "integrity": "sha512-j4gX3ctzgD4xVWllXAhm6M+kHFEvrFoUPFq60X/pgkjsWCocGuhtNfB0rW43ICG8hCnlz8IYl7O7b8V8qY7SPg==", - "dev": true, "engines": { "node": ">=14.18" } @@ -3435,7 +3425,6 @@ "version": "8.29.0", "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.29.0.tgz", "integrity": "sha512-nb93/m3SjQChQJFqJj3oNW3Rz/12yrT7jypTCire3c2hpYWG2uR5n8VY9UUMTA6HLNvdom6tckK7p3bXGXlF0w==", - "dev": true, "dependencies": { "@sentry/types": "8.29.0" }, @@ -9713,6 +9702,58 @@ "node": ">=10.13.0" } }, + "node_modules/copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "dev": true, + "dependencies": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + }, + "bin": { + "copyfiles": "copyfiles", + "copyup": "copyfiles" + } + }, + "node_modules/copyfiles/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/copyfiles/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/core-js-compat": { "version": "3.38.1", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.38.1.tgz", @@ -11103,23 +11144,6 @@ "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", "dev": true }, - "node_modules/editorconfig-checker": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/editorconfig-checker/-/editorconfig-checker-5.1.8.tgz", - "integrity": "sha512-GM/qCbXA8GajSqqjXiWZN49i0nizQV5PjkVKIwWB9rtsm/pztjnBC+4dts5wW2KdrP2zyMPEltWHtWQwoCadqg==", - "dev": true, - "bin": { - "ec": "dist/index.js", - "editorconfig-checker": "dist/index.js" - }, - "engines": { - "node": ">=18.0.0" - }, - "funding": { - "type": "buymeacoffee", - "url": "https://www.buymeacoffee.com/mstruebing" - } - }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -16320,6 +16344,26 @@ "node": ">=4" } }, + "node_modules/mini-css-extract-plugin": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.9.1.tgz", + "integrity": "sha512-+Vyi+GCCOHnrJ2VPS+6aPoXN2k2jgUzDRhTFLjjTBn23qyXJXkjUWQgTL+mXpF5/A8ixLdCc6kWsoeOjKGejKQ==", + "dev": true, + "dependencies": { + "schema-utils": "^4.0.0", + "tapable": "^2.2.1" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, "node_modules/minify-html-literals": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/minify-html-literals/-/minify-html-literals-1.3.5.tgz", @@ -16685,6 +16729,40 @@ "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", "dev": true }, + "node_modules/noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "node_modules/noms/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true + }, + "node_modules/noms/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/noms/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true + }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -20559,6 +20637,7 @@ "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", "dev": true, + "peer": true, "engines": { "node": ">= 18.12.0" }, diff --git a/package.json b/package.json index 8a08c8ab3533..b51894689af1 100644 --- a/package.json +++ b/package.json @@ -187,6 +187,7 @@ "karma-webpack": "5.0.1", "loader-utils": "3.3.1", "magic-comments-loader": "2.1.3", + "mini-css-extract-plugin": "2.9.1", "minify-html-literals-loader": "1.1.1", "neat-csv": "6.0.1", "parse-absolute-css-unit": "1.0.2", @@ -198,7 +199,6 @@ "start-server-and-test": "2.0.5", "storybook": "8.2.9", "strip-bom": "5.0.0", - "style-loader": "4.0.0", "svgo": "3.3.2", "svgo-loader": "4.0.0", "terser": "5.31.6", From fede76d5389f97b408b0cd78a73c456818706bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 20 Sep 2024 09:30:01 +0200 Subject: [PATCH 4/5] Remove alias --- .storybook/main.ts | 2 ++ Makefile | 2 +- buildtools/extract-ngeo-dependencies | 5 +++-- buildtools/webpack.commons.js | 4 ---- contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss | 2 +- examples/mapillarystreetview.scss | 2 +- package.json | 6 +----- src/objectediting/component.js | 4 ++-- srcapi/store/config.ts | 2 +- tsconfig.json | 6 +----- 10 files changed, 13 insertions(+), 22 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index dd6e10a9761a..790712575454 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,4 +1,5 @@ import type {StorybookConfig} from '@storybook/web-components-webpack5'; +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const config: StorybookConfig = { stories: ['../src/**/*.stories.@(ts|tsx)'], @@ -27,6 +28,7 @@ const config: StorybookConfig = { const mergedConfig = { ...config, module: {...config.module, rules: projectConfig.module.rules}, + plugins: [...config.plugins, new MiniCssExtractPlugin()], resolve: { ...config.resolve, alias: { diff --git a/Makefile b/Makefile index fb80b2cf7b23..d7b8cb84a8b6 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ GMF_EXAMPLES_JS_FILES := $(GMF_EXAMPLES_HTML_FILES:.html=.js) GMF_APPS += mobile desktop desktop_alt iframe_api mobile_alt oeedit GMF_APPS_JS_FILES = $(shell find contribs/gmf/apps/ -type f -name '*.js') $(shell find contribs/gmf/apps/ -type f -name '*.ts') -BUILD_JS_FILES = $(shell ls -1 *.js) $(shell ls -1 utils/*.js) $(shell find buildtools/ -type f -name '*.js') $(shell find cypress/ -type f -name '*.js') +BUILD_JS_FILES = $(shell ls -1 *.js) $(shell find buildtools/ -type f -name '*.js') $(shell find cypress/ -type f -name '*.js') GMF_APPS_PARTIALS_FILES = $(shell find contribs/gmf/apps/ -type f -name '*.html' -or -name '*.html.ejs') GMF_APPS_ALL_FILES = $(shell find contribs/gmf/apps/ -type f) $(NGEO_ALL_SRC_FILES) diff --git a/buildtools/extract-ngeo-dependencies b/buildtools/extract-ngeo-dependencies index 20c87d6dcbe2..e148d41fdce4 100755 --- a/buildtools/extract-ngeo-dependencies +++ b/buildtools/extract-ngeo-dependencies @@ -51,12 +51,13 @@ all_required_js = {a for a in all_required_js if not a.startswith("./")} all_required_js = {a for a in all_required_js if not a.startswith("ngeo/")} all_required_js = {a for a in all_required_js if not a.startswith("gmf/")} all_required_js = {a for a in all_required_js if not a.startswith("gmfapi/")} -all_required_js = {a for a in all_required_js if not a.startswith("goog/")} all_required_js = {a for a in all_required_js if not a.startswith("olcs/")} all_required_js = {a for a in all_required_js if not a.startswith("jsts/")} all_required_js = {a for a in all_required_js if not a.startswith("mapillary-js/")} all_required_js = { - a for a in all_required_js if a not in ("corejs-typeahead", "angular-float-thead", "moment") + a + for a in all_required_js + if a not in ("corejs-typeahead", "angular-float-thead", "moment", "mapillary-js", "jsts", "olsc") } all_required_js = {a for a in all_required_js if not a.endswith(".css")} for js in sorted(all_required_js): diff --git a/buildtools/webpack.commons.js b/buildtools/webpack.commons.js index d9f656e5d710..d3c1eccfea3e 100644 --- a/buildtools/webpack.commons.js +++ b/buildtools/webpack.commons.js @@ -176,11 +176,7 @@ module.exports = function (config) { api: path.resolve(__dirname, '../api/src'), lib: path.resolve(__dirname, '../lib'), gmf: path.resolve(__dirname, '../src'), - jsts: 'jsts/org/locationtech/jts', - olcs: 'ol-cesium/src/olcs', 'jquery-ui/datepicker': 'jquery-ui/ui/widgets/datepicker', // For angular-ui-date - // required to make it working with types - 'typeahead': 'corejs-typeahead', }, }, optimization: { diff --git a/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss b/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss index 6a2a6eff28b7..efa88cb9b8a7 100644 --- a/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss +++ b/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss @@ -23,7 +23,7 @@ @import './vars_desktop_alt.scss'; @import 'gmf/controllers/desktop.scss'; -@import '~mapillary-js/dist/mapillary.css'; +@import '~mapillary-js'; html { body { diff --git a/examples/mapillarystreetview.scss b/examples/mapillarystreetview.scss index 4cefe3d31189..ad66fc721d48 100644 --- a/examples/mapillarystreetview.scss +++ b/examples/mapillarystreetview.scss @@ -1,5 +1,5 @@ @import './common_styles.scss'; -@import 'mapillary-js/dist/mapillary.css'; +@import 'mapillary-js'; ngeo-streetview { display: block; diff --git a/package.json b/package.json index b51894689af1..ad5ef18a537e 100644 --- a/package.json +++ b/package.json @@ -54,11 +54,7 @@ "gmf": "./src", "api": "./api/src", "lib": "./lib", - "jsts": "jsts/org/locationtech/jts", - "olcs": "ol-cesium/src/olcs", - "jquery-ui/datepicker": "jquery-ui/ui/widgets/datepicker", - "mapillary-js/src/Mapillary": "mapillary-js/dist/mapillary.js", - "typeahead": "corejs-typeahead" + "jquery-ui/datepicker": "jquery-ui/ui/widgets/datepicker" }, "dependencies": { "@fortawesome/fontawesome-free": "5.15.4", diff --git a/src/objectediting/component.js b/src/objectediting/component.js index 0eb2ca614e86..f188b7cd0cc4 100644 --- a/src/objectediting/component.js +++ b/src/objectediting/component.js @@ -67,8 +67,8 @@ import olStyleStyle from 'ol/style/Style'; import {CollectionEvent} from 'ol/Collection'; // @ts-ignore: not supported import -import {OL3Parser} from 'jsts/io'; -import 'jsts/monkey'; +import {OL3Parser} from 'jsts/org/locationtech/jts/io'; +import 'jsts/org/locationtech/jts/monkey'; import htmlTemplate from './component.html'; /** diff --git a/srcapi/store/config.ts b/srcapi/store/config.ts index 3d63a8da1129..285cd0e02571 100644 --- a/srcapi/store/config.ts +++ b/srcapi/store/config.ts @@ -35,7 +35,7 @@ import {DefaultsOptions as OlInteractionDefaultsOptions} from 'ol/interaction/de import {Options as OlControlZoomOptions} from 'ol/control/Zoom'; import OlFeature from 'ol/Feature'; import OlGeomGeometry from 'ol/geom/Geometry'; -import 'typeahead'; +import 'corejs-typeahead'; import {InitOptions} from 'i18next'; /** diff --git a/tsconfig.json b/tsconfig.json index 8c5c9dd00c72..e154fa02378c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,11 +25,7 @@ "gmfapi/*": ["srcapi/*"], "api/*": ["api/src/*"], "lib/*": ["lib/*"], - "olcs/*": ["node_modules/ol-cesium/src/olcs/*"], - "mapillary-js/*": ["node_modules/mapillary-js/dist/mapillary.d.ts"], - "moment": ["node_modules/moment/moment.d.ts"], - "jsts/*": ["node_modules/@types/jsts/index.d.ts"], - "localforage/*": ["node_modules/localforage/*"] + "mapillary-js/*": ["node_modules/mapillary-js/dist/mapillary.d.ts"] } }, "include": ["src/**/*.js", "src/**/*.ts", "srcapi/**/*.ts", "lib/**/*.js", "api/src/**/*.js"], From 27eb048c5976932fe783de64f00bd58d5ce72810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 20 Sep 2024 14:37:50 +0200 Subject: [PATCH 5/5] Remove no more needed tilde --- contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss | 2 +- src/contextualdata/contextualdata.scss | 2 +- src/controllers/desktop.scss | 4 ++-- src/controllers/mobile.scss | 4 ++-- src/dropfile/dropfile.scss | 2 +- src/floor/floor.scss | 2 +- src/import/import.scss | 4 ++-- src/layertree/common.scss | 2 +- src/layertree/timeslider.scss | 4 ++-- src/permalink/share.scss | 2 +- src/profile/profile.scss | 2 +- src/query/grid.scss | 2 +- src/query/window.scss | 2 +- src/sass/components.scss | 2 +- src/sass/font.scss | 6 +++--- src/sass/iphone.scss | 2 +- src/sass/jquery-ui.scss | 12 ++++++------ src/sass/vars.scss | 6 +++--- src/spinner/loader.scss | 2 +- 19 files changed, 32 insertions(+), 32 deletions(-) diff --git a/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss b/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss index efa88cb9b8a7..da13cd6c5add 100644 --- a/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss +++ b/contribs/gmf/apps/desktop_alt/sass/desktop_alt.scss @@ -23,7 +23,7 @@ @import './vars_desktop_alt.scss'; @import 'gmf/controllers/desktop.scss'; -@import '~mapillary-js'; +@import 'mapillary-js'; html { body { diff --git a/src/contextualdata/contextualdata.scss b/src/contextualdata/contextualdata.scss index b9e02cf1b31f..6f241f30151f 100644 --- a/src/contextualdata/contextualdata.scss +++ b/src/contextualdata/contextualdata.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; +@import 'gmf/sass/vars.scss'; .popover.gmf-contextualdata { width: 25rem; diff --git a/src/controllers/desktop.scss b/src/controllers/desktop.scss index 13720f9868ff..f1706269a150 100644 --- a/src/controllers/desktop.scss +++ b/src/controllers/desktop.scss @@ -27,10 +27,10 @@ @import './vars_desktop.scss'; -@import '~ol/ol.css'; +@import 'ol/ol.css'; @import 'gmf/css/reset.css'; @import 'gmf/sass/gmf-font.scss'; -@import '~bootstrap/scss/bootstrap.scss'; +@import 'bootstrap/scss/bootstrap.scss'; @import 'gmf/sass/base.scss'; @import 'gmf/sass/map.scss'; @import 'gmf/sass/input-range.scss'; diff --git a/src/controllers/mobile.scss b/src/controllers/mobile.scss index 6844368b8244..5000e7652342 100644 --- a/src/controllers/mobile.scss +++ b/src/controllers/mobile.scss @@ -27,10 +27,10 @@ @import './vars_mobile.scss'; -@import '~ol/ol.css'; +@import 'ol/ol.css'; @import 'gmf/css/reset.css'; @import 'gmf/sass/gmf-font.scss'; -@import '~bootstrap/scss/bootstrap.scss'; +@import 'bootstrap/scss/bootstrap.scss'; @import 'gmf/sass/base.scss'; @import 'gmf/sass/map.scss'; @import 'gmf/sass/input-range.scss'; diff --git a/src/dropfile/dropfile.scss b/src/dropfile/dropfile.scss index ed4c8e264f84..b0fa5c467d22 100644 --- a/src/dropfile/dropfile.scss +++ b/src/dropfile/dropfile.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars_only.scss'; +@import 'gmf/sass/vars_only.scss'; $bgselector-image-size: 3rem; .gmf-file-alert-contained { diff --git a/src/floor/floor.scss b/src/floor/floor.scss index 7d26e4f229dc..1ac823624a31 100644 --- a/src/floor/floor.scss +++ b/src/floor/floor.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars_only.scss'; +@import 'gmf/sass/vars_only.scss'; gmf-floorselector.gmf-floorselector { overflow: hidden; diff --git a/src/import/import.scss b/src/import/import.scss index 47d5b2b56df2..565c6551e456 100644 --- a/src/import/import.scss +++ b/src/import/import.scss @@ -21,8 +21,8 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; -@import '~gmf/sass/typeahead.scss'; +@import 'gmf/sass/vars.scss'; +@import 'gmf/sass/typeahead.scss'; gmf-importdatasource { .gmf-importdatasource-url-form-group { diff --git a/src/layertree/common.scss b/src/layertree/common.scss index 19c913f65680..a9b46f68e433 100644 --- a/src/layertree/common.scss +++ b/src/layertree/common.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars_only.scss'; +@import 'gmf/sass/vars_only.scss'; @import '@fortawesome/fontawesome-free/scss/variables.scss'; .gmf-layertree-root-tools { diff --git a/src/layertree/timeslider.scss b/src/layertree/timeslider.scss index a8c631000100..fa8b1064d8c8 100644 --- a/src/layertree/timeslider.scss +++ b/src/layertree/timeslider.scss @@ -21,8 +21,8 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; -@import '~gmf/sass/input-range.scss'; +@import 'gmf/sass/vars.scss'; +@import 'gmf/sass/input-range.scss'; .gmf-time-slider { // 1.75rem come from bootstrap popover class .popover-content { padding: 0.56rem 0.87rem; } diff --git a/src/permalink/share.scss b/src/permalink/share.scss index 8029715deb67..b65ed9853a61 100644 --- a/src/permalink/share.scss +++ b/src/permalink/share.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; +@import 'gmf/sass/vars.scss'; gmf-share { .modal-body { diff --git a/src/profile/profile.scss b/src/profile/profile.scss index 5118ce43ed6f..06898e9a4989 100644 --- a/src/profile/profile.scss +++ b/src/profile/profile.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars_only.scss'; +@import 'gmf/sass/vars_only.scss'; $profile-height: 12.5rem; .panel.gmf-profile-container { diff --git a/src/query/grid.scss b/src/query/grid.scss index 68ca281cc1dd..866dcd2ed7f7 100644 --- a/src/query/grid.scss +++ b/src/query/grid.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; +@import 'gmf/sass/vars.scss'; $table-height: $displayquerygrid-height - $app-margin - 2 * $map-tools-size; diff --git a/src/query/window.scss b/src/query/window.scss index 2977b34259d1..53d9758b5a3a 100644 --- a/src/query/window.scss +++ b/src/query/window.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; +@import 'gmf/sass/vars.scss'; $displayquerywindow-tablet-width: calc(9 * $map-tools-size); $displayquerywindow-detailed-header-height: 3.12rem; diff --git a/src/sass/components.scss b/src/sass/components.scss index f8a43188c97f..524300e67482 100644 --- a/src/sass/components.scss +++ b/src/sass/components.scss @@ -13,4 +13,4 @@ @import 'ngeo/query/window.scss'; @import 'ngeo/editing/editing.css'; @import 'ngeo/sass/jquery-ui.scss'; -@import '~jquery-datetimepicker/jquery.datetimepicker.css'; +@import 'jquery-datetimepicker/jquery.datetimepicker.css'; diff --git a/src/sass/font.scss b/src/sass/font.scss index db5f72f93e90..8cc3668ff290 100644 --- a/src/sass/font.scss +++ b/src/sass/font.scss @@ -22,6 +22,6 @@ */ $fa-font-path: '~@fortawesome/fontawesome-free/webfonts'; -@import '~@fortawesome/fontawesome-free/scss/fontawesome.scss'; -@import '~@fortawesome/fontawesome-free/scss/regular.scss'; -@import '~@fortawesome/fontawesome-free/scss/solid.scss'; +@import '@fortawesome/fontawesome-free/scss/fontawesome.scss'; +@import '@fortawesome/fontawesome-free/scss/regular.scss'; +@import '@fortawesome/fontawesome-free/scss/solid.scss'; diff --git a/src/sass/iphone.scss b/src/sass/iphone.scss index 092bd298629d..b02a63429c11 100644 --- a/src/sass/iphone.scss +++ b/src/sass/iphone.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; +@import 'gmf/sass/vars.scss'; // Hack for ios Safari browser (UI overlapping on iOS 10) @media all and (orientation: landscape) { diff --git a/src/sass/jquery-ui.scss b/src/sass/jquery-ui.scss index 1803de16c156..1117ddf16db5 100644 --- a/src/sass/jquery-ui.scss +++ b/src/sass/jquery-ui.scss @@ -21,23 +21,23 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~jquery-ui/themes/base/core.css'; +@import 'jquery-ui/themes/base/core.css'; // @import "~jquery-ui/themes/base/accordion.css"; // @import "~jquery-ui/themes/base/autocomplete.css"; // @import "~jquery-ui/themes/base/button.css"; // @import "~jquery-ui/themes/base/checkboxradio.css"; // @import "~jquery-ui/themes/base/controlgroup.css"; -@import '~jquery-ui/themes/base/datepicker.css'; +@import 'jquery-ui/themes/base/datepicker.css'; // @import "~jquery-ui/themes/base/dialog.css"; -@import '~jquery-ui/themes/base/draggable.css'; +@import 'jquery-ui/themes/base/draggable.css'; // @import "~jquery-ui/themes/base/menu.css"; // @import "~jquery-ui/themes/base/progressbar.css"; -@import '~jquery-ui/themes/base/resizable.css'; +@import 'jquery-ui/themes/base/resizable.css'; // @import "~jquery-ui/themes/base/selectable.css"; // @import "~jquery-ui/themes/base/selectmenu.css"; // @import "~jquery-ui/themes/base/sortable.css"; -@import '~jquery-ui/themes/base/slider.css'; +@import 'jquery-ui/themes/base/slider.css'; // @import "~jquery-ui/themes/base/spinner.css"; // @import "~jquery-ui/themes/base/tabs.css"; // @import "~jquery-ui/themes/base/tooltip.css"; -@import '~jquery-ui/themes/base/theme.css'; +@import 'jquery-ui/themes/base/theme.css'; diff --git a/src/sass/vars.scss b/src/sass/vars.scss index 17f5c02ba638..5889f34a4cb2 100644 --- a/src/sass/vars.scss +++ b/src/sass/vars.scss @@ -23,9 +23,9 @@ @import 'gmf/sass/vars_only.scss'; -@import '~bootstrap/scss/_functions.scss'; -@import '~bootstrap/scss/_variables.scss'; -@import '~@fortawesome/fontawesome-free/scss/_variables.scss'; +@import 'bootstrap/scss/_functions.scss'; +@import 'bootstrap/scss/_variables.scss'; +@import '@fortawesome/fontawesome-free/scss/_variables.scss'; $table-border-color: $border-color !default; diff --git a/src/spinner/loader.scss b/src/spinner/loader.scss index 7d6ea9c9d545..2cc5e215ad79 100644 --- a/src/spinner/loader.scss +++ b/src/spinner/loader.scss @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -@import '~gmf/sass/vars.scss'; +@import 'gmf/sass/vars.scss'; .request-spinner { z-index: $above-all;