Skip to content

Commit 1e3fac5

Browse files
authored
Merge pull request #463 from hotosm/build/pnpm-node-lts
Migrate yarn --> pnpm and use node LTS 22.13
2 parents e2ef39b + 01e956c commit 1e3fac5

File tree

7 files changed

+8916
-24
lines changed

7 files changed

+8916
-24
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ temp_webmaps/Naivasha
5252
**/**/node_modules
5353
**/**/package-lock.json
5454
**/**/package.json
55-
**/**/yarn.lock
5655
**/**/.pnpm-store
5756

5857
# pdm

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"prettier": "^3.3.2",
77
"prettier-plugin-tailwindcss": "^0.6.5",
88
"tailwindcss": "^3.4.4"
9-
}
9+
},
10+
"packageManager": "pnpm@9.15.5+sha512.845196026aab1cc3f098a0474b64dfbab2afe7a1b4e91dd86895d8e4aa32a7a6d03049e2d0ad770bbe4de023a7122fb68c1a1d6e0d033c7076085f9d5d4800d4"
1011
}

src/frontend/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.16.0
1+
v22.13.0

src/frontend/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ARG for the base image
2-
ARG NODE_BASE=18.16.0-bullseye-slim
2+
ARG NODE_BASE=22.13.0-bullseye-slim
33
ARG MINIO_TAG=RELEASE.2024-08-03T04-33-23Z
44
ARG BASE64_ARGS_TO_ENV=ENV_VARS_BASE64_ENCODED_FOR_LIVE
55

@@ -10,17 +10,21 @@ WORKDIR /app
1010

1111
# Run development environment
1212
FROM base AS development
13-
ENTRYPOINT ["/bin/sh", "-c", "yarn; yarn start --host 0.0.0.0;"]
13+
ENTRYPOINT ["/bin/sh", "-c", "pnpm install; pnpm run start --host 0.0.0.0;"]
1414

1515
# Generate frontend build files
1616
FROM base AS build
1717
ARG BASE64_ARGS_TO_ENV
1818

19-
COPY ./package.json .
20-
RUN yarn
19+
COPY ./package.json pnpm-lock.yaml .
20+
# FIXME this npm install is a workaround due to https://github.com/nodejs/corepack/issues/627
21+
RUN npm install -g corepack@0.31.0
22+
# FIXME delete this line after fixed upstream
23+
RUN corepack prepare pnpm@9.15.5 --activate && corepack enable && corepack install
24+
RUN pnpm install
2125
COPY . /app
2226
RUN ( echo ${BASE64_ARGS_TO_ENV} | base64 -di ) > .env
23-
RUN yarn build
27+
RUN pnpm run build
2428

2529
# Copy static files to minio and generated index.html to volume
2630
FROM docker.io/minio/minio:${MINIO_TAG} AS live

src/frontend/README.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
## Getting started with the starter kit
22

3-
1. Do not use npm to install packages, use yarn. If you want to run `npm install` then delete the `yarn.lock` file and install the packages using npm.
3+
1. Do not use npm to install packages, use pnpm. If you want to run `npm install`
4+
then delete the `pnpm-lock.yaml` file and install the packages using npm.
45

56
2. Create a .env file and copy .env.example to .env
67

7-
3. Run `yarn dev` to start the development server.
8+
3. Run `pnpm dev` to start the development server.
89

910
4. If there is error on "/dashboard" route then comment out the proxy setup part on `vite.config.ts` file.
1011

11-
## Folder Structure
12-
13-
- [API](./src/api/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Api's for the project
14-
15-
- [Wrappers](./src/api/wrappers/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Wrappers
16-
17-
- [Routes](./src/routes/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Routes
18-
19-
- [Utils](./src/utils/readme.md)
20-
21-
- [UI](./src/ui/readme.md)
22-
2312
## Example to add shadcn component (select component- [link](https://ui.shadcn.com/docs/components/select) )
2413

2514
npx shadcn-ui add select

src/frontend/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"@cyntler/react-doc-viewer": "^1.17.0",
44
"@geomatico/maplibre-cog-protocol": "^0.3.1",
55
"@hotosm/gcp-editor": "^0.0.9",
6+
"@hotosm/ui": "0.2.0-b6",
67
"@mapbox/mapbox-gl-draw": "^1.4.2",
78
"@mapbox/mapbox-gl-draw-static-mode": "^1.0.1",
89
"@radix-ui/react-popover": "^1.0.6",
@@ -95,7 +96,7 @@
9596
"prettier --cache --write"
9697
]
9798
},
98-
"name": "starterkit-v2",
99+
"name": "drone-tm",
99100
"private": true,
100101
"scripts": {
101102
"build": "tsc && vite build",
@@ -105,5 +106,6 @@
105106
"start": "vite"
106107
},
107108
"type": "module",
108-
"version": "0.0.0"
109+
"version": "0.0.0",
110+
"packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
109111
}

0 commit comments

Comments
 (0)