Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate yarn --> pnpm and use node LTS 22.13 #463

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ temp_webmaps/Naivasha
**/**/node_modules
**/**/package-lock.json
**/**/package.json
**/**/yarn.lock
**/**/.pnpm-store

# pdm
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"prettier": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.5",
"tailwindcss": "^3.4.4"
}
},
"packageManager": "[email protected]+sha512.845196026aab1cc3f098a0474b64dfbab2afe7a1b4e91dd86895d8e4aa32a7a6d03049e2d0ad770bbe4de023a7122fb68c1a1d6e0d033c7076085f9d5d4800d4"
}
2 changes: 1 addition & 1 deletion src/frontend/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.0
v22.13.0
14 changes: 9 additions & 5 deletions src/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ARG for the base image
ARG NODE_BASE=18.16.0-bullseye-slim
ARG NODE_BASE=22.13.0-bullseye-slim
ARG MINIO_TAG=RELEASE.2024-08-03T04-33-23Z
ARG BASE64_ARGS_TO_ENV=ENV_VARS_BASE64_ENCODED_FOR_LIVE

Expand All @@ -10,17 +10,21 @@ WORKDIR /app

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

# Generate frontend build files
FROM base AS build
ARG BASE64_ARGS_TO_ENV

COPY ./package.json .
RUN yarn
COPY ./package.json pnpm-lock.yaml .
# FIXME this npm install is a workaround due to https://github.com/nodejs/corepack/issues/627
RUN npm install -g [email protected]
# FIXME delete this line after fixed upstream
RUN corepack prepare [email protected] --activate && corepack enable && corepack install
RUN pnpm install
COPY . /app
RUN ( echo ${BASE64_ARGS_TO_ENV} | base64 -di ) > .env
RUN yarn build
RUN pnpm run build

# Copy static files to minio and generated index.html to volume
FROM docker.io/minio/minio:${MINIO_TAG} AS live
Expand Down
17 changes: 3 additions & 14 deletions src/frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
## Getting started with the starter kit

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.
1. Do not use npm to install packages, use pnpm. If you want to run `npm install`
then delete the `pnpm-lock.yaml` file and install the packages using npm.

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

3. Run `yarn dev` to start the development server.
3. Run `pnpm dev` to start the development server.

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

## Folder Structure

- [API](./src/api/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Api's for the project

- [Wrappers](./src/api/wrappers/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Wrappers

- [Routes](./src/routes/readme.md)$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$--> Routes

- [Utils](./src/utils/readme.md)

- [UI](./src/ui/readme.md)

## Example to add shadcn component (select component- [link](https://ui.shadcn.com/docs/components/select) )

npx shadcn-ui add select
Expand Down
6 changes: 4 additions & 2 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"@cyntler/react-doc-viewer": "^1.17.0",
"@geomatico/maplibre-cog-protocol": "^0.3.1",
"@hotosm/gcp-editor": "^0.0.9",
"@hotosm/ui": "0.2.0-b6",
"@mapbox/mapbox-gl-draw": "^1.4.2",
"@mapbox/mapbox-gl-draw-static-mode": "^1.0.1",
"@radix-ui/react-popover": "^1.0.6",
Expand Down Expand Up @@ -95,7 +96,7 @@
"prettier --cache --write"
]
},
"name": "starterkit-v2",
"name": "drone-tm",
"private": true,
"scripts": {
"build": "tsc && vite build",
Expand All @@ -105,5 +106,6 @@
"start": "vite"
},
"type": "module",
"version": "0.0.0"
"version": "0.0.0",
"packageManager": "[email protected]+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
}
Loading