From dd1155d663e241d1f8c3e7c8ba1be5b208c9932b Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Thu, 18 Jul 2024 09:35:36 +0300 Subject: [PATCH 1/3] update docker file Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- Dockerfile | 2 ++ Makefile | 2 ++ apps/climatemappedafrica/next.config.js | 7 ++++++- apps/pesayetu/next.config.js | 7 ++++++- docker-compose.yml | 15 +++++++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7c054e264..bbce4baf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,6 +66,8 @@ RUN pnpm fetch COPY *.yaml *.json ./ COPY packages/commons-ui-core/package.json ./packages/commons-ui-core/package.json COPY packages/commons-ui-next/package.json ./packages/commons-ui-next/package.json +COPY packages/hurumap-core/package.json ./packages/hurumap-core/package.json +COPY packages/hurumap-next/package.json ./packages/hurumap-next/package.json # Next.js lints when doing production build COPY packages/eslint-config-commons-ui/package.json ./packages/eslint-config-commons-ui/package.json # TODO(kilemensi): Figure out why this is needed (charterafrica, codeforafrica) diff --git a/Makefile b/Makefile index a9d8c0067..8947d374e 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ charterafrica: codeforafrica: $(COMPOSE_BUILD_ENV) $(COMPOSE) --env-file apps/codeforafrica/.env.local up codeforafrica --build +climatemappedafrica: + $(COMPOSE_BUILD_ENV) $(COMPOSE) --env-file apps/climatemappedafrica/.env.local up climatemappedafrica --build down: $(COMPOSE_BUILD_ENV) $(COMPOSE) down --volumes diff --git a/apps/climatemappedafrica/next.config.js b/apps/climatemappedafrica/next.config.js index d8eda86ff..2c50a972d 100644 --- a/apps/climatemappedafrica/next.config.js +++ b/apps/climatemappedafrica/next.config.js @@ -25,7 +25,12 @@ module.exports = { }, output: "standalone", reactStrictMode: false, - transpilePackages: ["@commons-ui/core", "@commons-ui/next", "@hurumap/core"], + transpilePackages: [ + "@commons-ui/core", + "@commons-ui/next", + "@hurumap/core", + "@hurumap/next", + ], webpack: (config) => { config.module.rules.push({ test: /\.svg$/, diff --git a/apps/pesayetu/next.config.js b/apps/pesayetu/next.config.js index 12a357b43..6e4e94200 100644 --- a/apps/pesayetu/next.config.js +++ b/apps/pesayetu/next.config.js @@ -25,7 +25,12 @@ module.exports = { }, output: "standalone", reactStrictMode: false, - transpilePackages: ["@commons-ui/core", "@commons-ui/next", "@hurumap/core"], + transpilePackages: [ + "@commons-ui/core", + "@commons-ui/next", + "@hurumap/core", + "@hurumap/next", + ], webpack: (config) => { config.module.rules.push({ test: /\.svg$/, diff --git a/docker-compose.yml b/docker-compose.yml index 9646c6eaf..e85adf903 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,21 @@ services: ports: - 3000:3000 + climatemappedafrica: + build: + context: . + target: climatemappedafrica-runner + args: + - HURUMAP_API_URL + environment: + HURUMAP_API_URL: ${HURUMAP_API_URL} + S3_UPLOAD_KEY: ${S3_UPLOAD_KEY} + S3_UPLOAD_SECRET: ${S3_UPLOAD_SECRET} + S3_UPLOAD_BUCKET: ${S3_UPLOAD_BUCKET} + S3_UPLOAD_REGION: ${S3_UPLOAD_REGION} + ports: + - 3000:3000 + pesayetu: build: context: . From 095fcfb06d552749c8de879de31fa2598b3e66d1 Mon Sep 17 00:00:00 2001 From: Michael Hudson Nkotagu Date: Thu, 18 Jul 2024 13:11:19 +0300 Subject: [PATCH 2/3] fix: Fix failing build due to missing commons-ui package path config --- apps/climatemappedafrica/jsconfig.json | 4 +++- apps/climatemappedafrica/package.json | 4 ++++ pnpm-lock.yaml | 9 ++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/climatemappedafrica/jsconfig.json b/apps/climatemappedafrica/jsconfig.json index 1020d5de8..8db4bfdc8 100644 --- a/apps/climatemappedafrica/jsconfig.json +++ b/apps/climatemappedafrica/jsconfig.json @@ -2,7 +2,9 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@/climatemappedafrica/*": ["./src/*"] + "@/climatemappedafrica/*": ["./src/*"], + "@/commons-ui/core/*": ["../../packages/commons-ui-core/src/*"], + "@/commons-ui/next/*": ["../../packages/commons-ui-next/src/*"] } }, "exclude": ["node_modules"] diff --git a/apps/climatemappedafrica/package.json b/apps/climatemappedafrica/package.json index d4760e94f..d1db1c318 100644 --- a/apps/climatemappedafrica/package.json +++ b/apps/climatemappedafrica/package.json @@ -71,6 +71,7 @@ "vega-tooltip": "^0.33.0", "video.js": "^8.16.1", "videojs-youtube": "^3.0.1", + "webpack": "^5.93.0", "xlsx": "^0.18.5" }, "devDependencies": { @@ -113,5 +114,8 @@ "react-test-renderer": "^18.3.1", "svg-url-loader": "^8.0.0", "typescript": "^5.5.3" + }, + "engines": { + "node": "20.x" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77dfb1332..7b99828cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -387,6 +387,9 @@ importers: videojs-youtube: specifier: ^3.0.1 version: 3.0.1(video.js@8.16.1) + webpack: + specifier: ^5.93.0 + version: 5.93.0(esbuild@0.18.20) xlsx: specifier: ^0.18.5 version: 0.18.5 @@ -1007,7 +1010,7 @@ importers: version: 5.0.0-alpha.0(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.1(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(formik@2.4.6(react@18.3.1))(react@18.3.1)(tiny-warning@1.0.3) formik-mui-lab: specifier: ^1.0.0 - version: 1.0.0(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/lab@5.0.0-alpha.155(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.1(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/material@5.16.1(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(formik@2.4.6(react@18.3.1))(react@18.3.1)(tiny-warning@1.0.3) + version: 1.0.0(uwokqjev6b7ignvfnuri4yvwiy) jwt-decode: specifier: ^4.0.0 version: 4.0.0 @@ -23154,8 +23157,8 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 - ? formik-mui-lab@1.0.0(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/lab@5.0.0-alpha.155(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.1(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/material@5.16.1(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(formik@2.4.6(react@18.3.1))(react@18.3.1)(tiny-warning@1.0.3) - : dependencies: + formik-mui-lab@1.0.0(uwokqjev6b7ignvfnuri4yvwiy): + dependencies: '@emotion/react': 11.11.4(@types/react@18.3.3)(react@18.3.1) '@emotion/styled': 11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1) '@mui/lab': 5.0.0-alpha.155(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.1(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) From 03ecc677fd058bfae5c5cbbc8733a60b203cb990 Mon Sep 17 00:00:00 2001 From: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:13:41 +0300 Subject: [PATCH 3/3] PR Reviews Signed-off-by: Kipruto <43873157+kelvinkipruto@users.noreply.github.com> --- Dockerfile | 6 ++++-- Makefile | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bbce4baf3..1781522ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,8 +66,6 @@ RUN pnpm fetch COPY *.yaml *.json ./ COPY packages/commons-ui-core/package.json ./packages/commons-ui-core/package.json COPY packages/commons-ui-next/package.json ./packages/commons-ui-next/package.json -COPY packages/hurumap-core/package.json ./packages/hurumap-core/package.json -COPY packages/hurumap-next/package.json ./packages/hurumap-next/package.json # Next.js lints when doing production build COPY packages/eslint-config-commons-ui/package.json ./packages/eslint-config-commons-ui/package.json # TODO(kilemensi): Figure out why this is needed (charterafrica, codeforafrica) @@ -442,6 +440,8 @@ CMD ["node", "dist/server.js"] FROM base-deps as pesayetu-deps +COPY packages/hurumap-core/package.json ./packages/hurumap-core/package.json +COPY packages/hurumap-next/package.json ./packages/hurumap-next/package.json COPY apps/pesayetu/package.json ./apps/pesayetu/package.json # Use virtual store: https://pnpm.io/cli/fetch#usage-scenario @@ -618,6 +618,8 @@ CMD ["node", "apps/vpnmanager/server.js"] FROM base-deps as climatemappedafrica-deps + COPY packages/hurumap-core/package.json ./packages/hurumap-core/package.json + COPY packages/hurumap-next/package.json ./packages/hurumap-next/package.json COPY apps/climatemappedafrica/package.json ./apps/climatemappedafrica/package.json # Use virtual store: https://pnpm.io/cli/fetch#usage-scenario diff --git a/Makefile b/Makefile index 8947d374e..f0bc56697 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ codeforafrica: climatemappedafrica: $(COMPOSE_BUILD_ENV) $(COMPOSE) --env-file apps/climatemappedafrica/.env.local up climatemappedafrica --build + down: $(COMPOSE_BUILD_ENV) $(COMPOSE) down --volumes