Skip to content

Commit

Permalink
Merge pull request #11378 from camptocamp/renovate/master-patch-ngeo
Browse files Browse the repository at this point in the history
Update dependency ngeo to v2.9.0-latest.20240920T130728Z.f0b587f58 (master)
  • Loading branch information
sbrunner authored Sep 27, 2024
2 parents 357b4c8 + 87e875c commit bca9358
Show file tree
Hide file tree
Showing 14 changed files with 12,563 additions and 2,676 deletions.
18 changes: 5 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ COPY scripts/extract-messages.js /opt/c2cgeoportal/geoportal/

ENV TEST=false
ENV PATH=/opt/c2cgeoportal/geoportal/node_modules/.bin:$PATH
ENV NODE_PATH=/opt/c2cgeoportal/geoportal/node_modules

#############################################################################################################
# Finally used for all misk task, will not be used on prod runtime
Expand All @@ -88,7 +89,6 @@ FROM base AS tools

SHELL ["/bin/bash", "-o", "pipefail", "-cux"]

ENV NODE_PATH=/usr/lib/node_modules
CMD ["tail", "--follow", "--zero-terminated", "/dev/null"]

RUN --mount=type=cache,target=/var/lib/apt/lists \
Expand Down Expand Up @@ -116,23 +116,15 @@ WORKDIR /opt/c2cgeoportal
COPY ci/applications*.yaml .
RUN c2cciutils-download-applications --applications-file=applications.yaml --versions-file=applications-versions.yaml

COPY bin/npm-packages /usr/bin/
WORKDIR /opt/c2cgeoportal/geoportal
COPY geoportal/package.json geoportal/package-lock.json geoportal/.snyk ./

# hadolint ignore=DL3016,SC2046
RUN --mount=type=cache,target=/var/cache,sharing=locked \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/tmp \
npm install --omit=optional \
&& npm-packages \
@types @typescript-eslint @storybook ol-cesium jasmine-core karma karma-chrome-launcher \
karma-jasmine karma-sinon karma-sourcemap-loader karma-webpack \
react react-dom cypress chromatic jscodeshift start-server-and-test \
typedoc typescript \
angular-gettext-tools commander puppeteer url-parse eslint \
--src=package.json --src=node_modules/ngeo/package.json --dst=npm-packages \
&& npm install --omit=optional --global --unsafe-perm $(cat /opt/c2cgeoportal/geoportal/npm-packages)
npm --ignore-scripts install \
&& puppeteer browsers install chrome

COPY admin/package.json admin/package-lock.json admin/.snyk /opt/c2cgeoportal/admin/
WORKDIR /opt/c2cgeoportal/admin
Expand Down Expand Up @@ -161,10 +153,10 @@ COPY build.mk lingva.cfg ./

RUN make --makefile=build.mk build \
&& mkdir -p 'geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/geoportal/interfaces/' \
&& import-ngeo-apps --html --canvas desktop_alt /usr/lib/node_modules/ngeo/contribs/gmf/apps/desktop_alt/index.html.ejs \
&& import-ngeo-apps --html --canvas desktop_alt geoportal/node_modules/ngeo/contribs/gmf/apps/desktop_alt/index.html.ejs \
'geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/geoportal/interfaces/desktop_alt.html.mako' \
&& mkdir -p 'geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/geoportal/{{cookiecutter.package}}_geoportal/static/images/' \
&& cp /usr/lib/node_modules/ngeo/contribs/gmf/apps/desktop/image/background-layer-button.png \
&& cp geoportal/node_modules/ngeo/contribs/gmf/apps/desktop/image/background-layer-button.png \
'geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/geoportal/{{cookiecutter.package}}_geoportal/static/images/'

COPY commons/ commons/
Expand Down
6 changes: 3 additions & 3 deletions bin/extract-ngeo-dependencies
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright (c) 2018-2023, Camptocamp SA
# Copyright (c) 2018-2024, Camptocamp SA
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -34,8 +34,8 @@ all_required_js = set()
IMPORT_FROM = re.compile(r"^import +.* +from +'(.*)';$")
ONLY_IMPORT = re.compile(r"^import +'(.*)';$")
for pathname in (
"/usr/lib/node_modules/ngeo/src/**/*.js",
"/usr/lib/node_modules/ngeo/contribs/gmf/src/**/*.js",
"geoportal/node_modules/ngeo/src/**/*.js",
"geoportal/node_modules/ngeo/contribs/gmf/src/**/*.js",
):
for filename in glob.glob(pathname, recursive=True):
with open(filename) as js:
Expand Down
113 changes: 0 additions & 113 deletions bin/npm-packages

This file was deleted.

30 changes: 15 additions & 15 deletions build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,72 +46,72 @@ build: \
.PHONY: import-ngeo-apps
import-ngeo-apps: $(API_FILES) $(APPS_FILES) $(APPS_FILES_ALT) $(STATIC_PATH)/header.html

$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/%.html.ejs: /usr/lib/node_modules/ngeo/contribs/gmf/apps/%/index.html.ejs
$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/%.html.ejs: geoportal/node_modules/ngeo/contribs/gmf/apps/%/index.html.ejs
mkdir --parent $(dir $@)
import-ngeo-apps --html $* $< $@

$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/Controller%.js: /usr/lib/node_modules/ngeo/contribs/gmf/apps/%/Controller.js
$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/Controller%.js: geoportal/node_modules/ngeo/contribs/gmf/apps/%/Controller.js
mkdir --parent $(dir $@)
import-ngeo-apps --js $* $< $@

$(APPS_PACKAGE_PATH_ALT)/static-ngeo/js/apps/%.html.ejs: \
/usr/lib/node_modules/ngeo/contribs/gmf/apps/%/index.html.ejs \
geoportal/node_modules/ngeo/contribs/gmf/apps/%/index.html.ejs \
geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/
mkdir --parent $(dir $@)
import-ngeo-apps --html $* $< $@

$(APPS_PACKAGE_PATH_ALT)/static-ngeo/js/apps/Controller%.js: \
/usr/lib/node_modules/ngeo/contribs/gmf/apps/%/Controller.js \
geoportal/node_modules/ngeo/contribs/gmf/apps/%/Controller.js \
geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/
mkdir --parent $(dir $@)
import-ngeo-apps --js $* $< $@

$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/sass/%.scss:
mkdir --parent $(dir $@)
cp /usr/lib/node_modules/ngeo/contribs/gmf/apps/$*/sass/$*.scss $@
cp geoportal/node_modules/ngeo/contribs/gmf/apps/$*/sass/$*.scss $@

$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/sass/vars_%.scss:
mkdir --parent $(dir $@)
cp /usr/lib/node_modules/ngeo/contribs/gmf/apps/$*/sass/vars_$*.scss $@
cp geoportal/node_modules/ngeo/contribs/gmf/apps/$*/sass/vars_$*.scss $@

$(APPS_PACKAGE_PATH_ALT)/static-ngeo/js/apps/sass/%.scss: \
geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/
mkdir --parent $(dir $@)
cp /usr/lib/node_modules/ngeo/contribs/gmf/apps/$*/sass/$*.scss $@
cp geoportal/node_modules/ngeo/contribs/gmf/apps/$*/sass/$*.scss $@

$(APPS_PACKAGE_PATH_ALT)/static-ngeo/js/apps/sass/vars_%.scss: \
geoportal/c2cgeoportal_geoportal/scaffolds/update/{{cookiecutter.project}}/CONST_create_template/
mkdir --parent $(dir $@)
cp /usr/lib/node_modules/ngeo/contribs/gmf/apps/$*/sass/vars_$*.scss $@
cp geoportal/node_modules/ngeo/contribs/gmf/apps/$*/sass/vars_$*.scss $@

$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/contextualdata.html: /usr/lib/node_modules/ngeo/contribs/gmf/apps/desktop/contextualdata.html
$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/contextualdata.html: geoportal/node_modules/ngeo/contribs/gmf/apps/desktop/contextualdata.html
mkdir --parent $(dir $@)
cp $< $@

$(STATIC_PATH)/header.html: /usr/lib/node_modules/ngeo/contribs/gmf/apps/desktop/header.html
$(STATIC_PATH)/header.html: geoportal/node_modules/ngeo/contribs/gmf/apps/desktop/header.html
mkdir --parent $(dir $@)
cp $< $@

$(STATIC_PATH)/images/%: /usr/lib/node_modules/ngeo/contribs/gmf/apps/desktop/image/%
$(STATIC_PATH)/images/%: geoportal/node_modules/ngeo/contribs/gmf/apps/desktop/image/%
$(PRERULE_CMD)
mkdir --parent $(dir $@)
cp $< $@

$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/image/%: /usr/lib/node_modules/ngeo/contribs/gmf/apps/desktop/image/%
$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/image/%: geoportal/node_modules/ngeo/contribs/gmf/apps/desktop/image/%
$(PRERULE_CMD)
mkdir --parent $(dir $@)
cp $< $@

$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/image/%: /usr/lib/node_modules/ngeo/contribs/gmf/apps/desktop_alt/image/%
$(APPS_PACKAGE_PATH)/static-ngeo/js/apps/image/%: geoportal/node_modules/ngeo/contribs/gmf/apps/desktop_alt/image/%
$(PRERULE_CMD)
mkdir --parent $(dir $@)
cp $< $@

$(APPS_PACKAGE_PATH)/static-ngeo/api/api.css: /usr/lib/node_modules/ngeo/api/src/api.css
$(APPS_PACKAGE_PATH)/static-ngeo/api/api.css: geoportal/node_modules/ngeo/api/src/api.css
mkdir --parent $(dir $@)
cp $< $@

$(STATIC_PATH)/apihelp: /usr/lib/node_modules/ngeo/api/dist/apihelp
$(STATIC_PATH)/apihelp: geoportal/node_modules/ngeo/api/dist/apihelp
rm --recursive --force $@
cp -r $< $@
mv $@/apihelp.html $@/index.html.tmpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN make build
RUN mv webpack.apps.js webpack.apps.js.tmpl

ENTRYPOINT [ "/usr/bin/eval-templates" ]
CMD [ "webpack-dev-server", "--mode=development", "--debug", "--watch", "--no-inline" ]
CMD [ "webpack", "serve", "--open", "--mode=development", "--watch", "--no-inline" ]

###############################################################################

Expand All @@ -33,7 +33,8 @@ WORKDIR /app
COPY . /app
# Workaround, see:https://github.com/moby/moby/issues/37965
RUN true
COPY --from=builder /usr/lib/node_modules/ngeo/dist/* /etc/static-ngeo/
COPY --from=builder /opt/c2cgeoportal/geoportal/node_modules/ngeo/dist/* /etc/static-ngeo/
RUN rm /etc/static-ngeo/*.html
COPY --from=builder /etc/static-ngeo/* /etc/static-ngeo/
COPY --from=builder /app/alembic.ini /app/alembic.yaml ./
RUN chmod go+w /etc/static-ngeo/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,12 @@ const TerserPlugin = require('terser-webpack-plugin');

const destDir = '/etc/static-ngeo/';

const babelPresets = [
[
require.resolve('@babel/preset-env'),
{
targets: 'defaults, > 0.1% in CH, > 0.1% in FR, Firefox ESR and supports es6-class and not iOS < 10',
modules: false,
loose: true,
},
],
];

module.exports = (env, argv) => {
const library = argv.library ? argv.library : '{{cookiecutter.package}}';
return {
entry: path.resolve(__dirname, '{{cookiecutter.package}}_geoportal/static-ngeo/api/index.js'),
devtool: 'source-map',
mode: 'production',
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: babelPresets,
babelrc: false,
comments: false,
plugins: [
require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
require.resolve('@babel/plugin-proposal-optional-chaining'),
],
},
},
},
],
},
output: {
filename: 'api.js',
path: destDir,
Expand All @@ -51,22 +21,17 @@ module.exports = (env, argv) => {
minimizer: [
new TerserPlugin({
parallel: true,
sourceMap: true,
terserOptions: {
compress: false,
},
}),
],
},
resolve: {
modules: [
'/usr/lib/node_modules',
'/usr/lib/node_modules/ol/node_modules',
'/usr/lib/node_modules/proj4/node_modules',
],
modules: ['/opt/c2cgeoportal/geoportal/node_modules'],
alias: {
api: '/usr/lib/node_modules/ngeo/api/src',
ngeo: '/usr/lib/node_modules/ngeo/src',
api: '/opt/c2cgeoportal/geoportal/node_modules/ngeo/distlib/api/src',
ngeo: '/opt/c2cgeoportal/geoportal/node_modules/ngeo/distlib/src',
},
},
resolveLoader: {
Expand Down
Loading

0 comments on commit bca9358

Please sign in to comment.