Merge branch 'use_bun_instead_of_yarn' into federation_try_fix_oneTimeCode

This commit is contained in:
einhornimmond 2025-10-12 12:16:24 +02:00
commit 905388f1a0
33 changed files with 891 additions and 13649 deletions

View File

@ -403,10 +403,8 @@ jobs:
##########################################################################
# Push release tag to GitHub #############################################
##########################################################################
- name: yarn install
run: yarn install
- name: generate changelog
run: yarn auto-changelog --commit-limit 0 --latest-version ${{ env.VERSION }} --unreleased-only
run: npx auto-changelog --commit-limit 0 --latest-version ${{ env.VERSION }} --unreleased-only
- name: package-version-to-git-release
continue-on-error: true # Will fail if tag exists
id: create_release

View File

@ -95,6 +95,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: install bun
uses: oven-sh/setup-bun@v2
- name: Admin Interface | Locales
run: cd admin && yarn locales
run: cd admin && bun locales

View File

@ -102,6 +102,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: install bun
uses: oven-sh/setup-bun@v2
- name: Backend | Locales
run: cd backend && yarn locales
run: cd backend && bun locales

View File

@ -28,7 +28,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: install bun
uses: oven-sh/setup-bun@v2
with:
@ -38,8 +38,8 @@ jobs:
run: bun install --filter config-schema --frozen-lockfile
- name: typecheck
run: cd config-schema && yarn typecheck
run: cd config-schema && bun run typecheck
- name: unit tests
run: cd config-schema && yarn test
run: cd config-schema && bun run test

View File

@ -29,7 +29,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: install bun
uses: oven-sh/setup-bun@v2
with:

View File

@ -72,7 +72,7 @@ jobs:
id: e2e-tests
run: |
cd e2e-tests/
yarn run cypress run
bun cypress run
- name: End-to-end tests | if tests failed, compile html report
if: ${{ failure() && steps.e2e-tests.conclusion == 'failure' }}

View File

@ -59,7 +59,7 @@ jobs:
run: bun install --filter frontend --frozen-lockfile
- name: Frontend | Unit tests
run: cd frontend && yarn test
run: cd frontend && bun run test
lint:
if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.frontend == 'true'
@ -110,6 +110,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: install bun
uses: oven-sh/setup-bun@v2
- name: Frontend | Locales
run: cd frontend && yarn locales
run: cd frontend && bun run locales

View File

@ -37,8 +37,8 @@ jobs:
run: bun install --filter shared --frozen-lockfile
- name: typecheck
run: cd shared && yarn typecheck
run: cd shared && bun run typecheck
- name: unit tests
run: cd shared && yarn test
run: cd shared && bun run test

12
.vscode/launch.json vendored
View File

@ -9,7 +9,7 @@
"request": "launch",
"name": "Database Debug Tests",
"stopOnEntry": true,
"runtimeExecutable": "yarn",
"runtimeExecutable": "bun",
"runtimeArgs": [
"run",
"test"
@ -25,7 +25,7 @@
"type": "node",
"request": "launch",
"name": "DHT-Node Debug Tests",
"runtimeExecutable": "yarn",
"runtimeExecutable": "bun",
"runtimeArgs": [
"run",
"test:debug"
@ -42,7 +42,7 @@
"request": "launch",
"name": "DHT-Node Debug",
"stopOnEntry": true,
"runtimeExecutable": "yarn",
"runtimeExecutable": "bun",
"runtimeArgs": [
"run",
"dev"
@ -58,7 +58,7 @@
"type": "node",
"request": "launch",
"name": "Federation Debug Tests",
"runtimeExecutable": "yarn",
"runtimeExecutable": "bun",
"runtimeArgs": [
"run",
"test:debug"
@ -75,7 +75,7 @@
"request": "launch",
"name": "Federation Debug",
"stopOnEntry": true,
"runtimeExecutable": "yarn",
"runtimeExecutable": "bun",
"runtimeArgs": [
"run",
"dev"
@ -92,7 +92,7 @@
"request": "launch",
"name": "Backend Debug",
"stopOnEntry": true,
"runtimeExecutable": "yarn",
"runtimeExecutable": "bun",
"runtimeArgs": [
"run",
"dev"

View File

@ -48,8 +48,6 @@ RUN bun install --global turbo
# Add bun's global bin directory to PATH
ENV PATH="/root/.bun/bin:${PATH}"
#RUN yarn global add turbo
# Settings
## Expose Container Port
EXPOSE ${BACKEND_PORT}
@ -85,10 +83,6 @@ COPY --chown=app:app ./ ./
# yarn install
RUN bun install --frozen-lockfile --non-interactive
# try with bun, use yarn if problems occur
# go into admin folder and use yarn to install local dependencies which need to use nohoist for @vee-validate/i18n which isn't supported by bun
#RUN bun install --frozen-lockfile
##################################################################################
# TEST ###########################################################################
@ -136,7 +130,7 @@ WORKDIR ${DOCKER_WORKDIR}
# Copy only the build artifacts from the previous build stage
COPY --chown=app:app --from=build /app/node_modules ./node_modules
COPY --chown=app:app --from=build /app/package.json ./package.json
COPY --chown=app:app --from=build /app/yarn.lock ./yarn.lock
COPY --chown=app:app --from=build /app/bun.lock ./bun.lock
COPY --chown=app:app --from=build /app/turbo.json ./turbo.json
# and Turbo cache to prevent rebuilding
COPY --chown=app:app --from=build /tmp/turbo ./tmp/turbo

View File

@ -88,13 +88,6 @@ bun install
bun install --global turbo@^2
```
If this does not work, try to use [yarn](https://classic.yarnpkg.com/en/docs/install) instead
```bash
yarn install
yarn global add turbo@^2
```
- **Development Mode (Hot-Reload)**:
Launches Gradido with hot-reloading for fast iteration.
@ -124,10 +117,6 @@ The installation of dockers depends on your selected product package from the [d
* In case the docker desktop will not start correctly because of previous docker installations, then please clean the used directories of previous docker installation - `C:\Users` - before you retry starting docker desktop. For further problems executing docker desktop please take a look in this description "[logs and trouble shooting](https://docs.docker.com/desktop/windows/troubleshoot/)"
* In case your docker desktop installation causes high memory consumption per vmmem process, then please take a look at this description "[vmmen process consuming too much memory (Docker Desktop)](https://dev.to/tallesl/vmmen-process-consuming-too-much-memory-docker-desktop-273p)"
### yarn
For the Gradido build process the yarn package manager will be used. Please download and install [yarn for windows](https://phoenixnap.com/kb/yarn-windows) by following the instructions there.
### ⚡ Workspaces and Bun Compatibility
The project now uses **Workspaces**, and work is ongoing to make all modules **Bun-compatible**. You can currently use `bun install`, but not all modules are fully Bun-compatible yet.
@ -143,12 +132,10 @@ To install dependencies with Bun:
bun install
```
Note that some modules are still not fully compatible with Bun. Therefore, continue using **Yarn** for development if you run into any issues.
### EMFILE: too many open files
With
```bash
yarn docker_dev
bun docker_dev
```
or also
```bash
@ -161,11 +148,11 @@ which you are working on in dev mode and the rest in production mode.
For example if you are only working on the frontend, you can start the frontend in dev mode and the rest in production mode:
```bash
yarn docker_dev frontend
bun docker_dev frontend
```
and in another bash
```bash
yarn docker backend admin database nginx --no-deps
bun docker backend admin database nginx --no-deps
```
or local with turbo
```bash
@ -218,10 +205,10 @@ Currently Modules `frontend`, `admin`, `share` and `core` running the tests in p
`database`, `backend`, `dht-node` and `federation` are running the tests still serially.
### Clear
In root folder calling `yarn clear` will clear all turbo caches, node_modules and build folders of all workspaces for a clean rebuild.
In root folder calling `bun clear` will clear all turbo caches, node_modules and build folders of all workspaces for a clean rebuild.
```bash
yarn clear
bun clear
```
@ -254,13 +241,13 @@ To generate the Changelog and set a new Version you should use the following com
```bash
git fetch --all
yarn release
bun release
```
The first command `git fetch --all` will make sure you have all tags previously defined which is required to generate a correct changelog. The second command `yarn release` will execute the changelog tool and set version numbers in the main package and sub-packages. It is required to do `yarn install` before you can use this command.
The first command `git fetch --all` will make sure you have all tags previously defined which is required to generate a correct changelog. The second command `bun release` will execute the changelog tool and set version numbers in the main package and sub-packages. It is required to do `bun install` before you can use this command.
After generating a new version you should commit the changes. This will be the CHANGELOG.md and several package.json files. This commit will be omitted in the changelog.
Note: The Changelog will be regenerated with all tags on release on the external builder tool, but will not be checked in there. The Changelog on the github release will therefore always be correct, on the repo it might be incorrect due to missing tags when executing the `yarn release` command.
Note: The Changelog will be regenerated with all tags on release on the external builder tool, but will not be checked in there. The Changelog on the github release will therefore always be correct, on the repo it might be incorrect due to missing tags when executing the `bun release` command.
## How the different .env work on deploy

View File

@ -1,26 +1,48 @@
# admin
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
turbo dev
```
or from root folder:
```
turbo admin#dev
```
### Compiles and minifies for production
```
yarn build
turbo build
```
or from root folder:
```
turbo admin#build
```
### Lints and fixes files
```
yarn lint
turbo lint
```
or from root folder:
```
turbo admin#lint
```
### Unit tests
```
yarn test
turbo test
```
For filtering out single tests:
```
turbo test -- <test_name>
```
Everything after -- will be passed to vitest.
or from root folder:
```
turbo admin#test
```

View File

@ -72,7 +72,7 @@
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "8.7.1",
"joi": "^17.13.3",
"joi": "17.13.3",
"jsdom": "^25.0.0",
"lightningcss": "^1.30.1",
"mock-apollo-client": "^1.2.1",

View File

@ -5,7 +5,7 @@
## Seed DB
```bash
yarn seed
turbo seed
```
Deletes all data in database. Then seeds data in database.

View File

@ -76,7 +76,7 @@
"helmet": "^5.1.1",
"i18n": "^0.15.1",
"jest": "27.2.4",
"joi": "^17.13.3",
"joi": "17.13.3",
"jose": "^4.14.4",
"klicktipp-api": "^1.0.2",
"lodash.clonedeep": "^4.5.0",

1255
bun.lock

File diff suppressed because it is too large Load Diff

View File

@ -32,7 +32,7 @@
},
"dependencies": {
"esbuild": "^0.25.2",
"joi": "^17.13.3",
"joi": "17.13.3",
"log4js": "^6.9.1",
"source-map-support": "^0.5.21",
"yoctocolors-cjs": "^2.1.2",

View File

@ -38,6 +38,7 @@
"devDependencies": {
"@biomejs/biome": "2.0.0",
"@types/i18n": "^0.13.4",
"@types/minimatch": "6.0.0",
"@types/node": "^17.0.21",
"@types/sodium-native": "^2.3.5",
"config-schema": "*",

View File

@ -47,7 +47,8 @@
// "baseUrl": ".", /* Base directory to resolve non-absolute module names. */
// "paths": { }, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [".", "../database"], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
/* List of folders to include type definitions from. */
"typeRoots": ["./node_modules/@types", "../node_modules/@types"],
// "types": ["bun-types"], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */

View File

@ -63,7 +63,7 @@ COPY --chown=app:app . .
FROM installer as build-shared
RUN bun install --filter shared --no-cache --frozen-lockfile \
&& cd shared && yarn typecheck && yarn build
&& cd shared && bun run typecheck && bun run build
##################################################################################
# Build ##########################################################################
@ -75,7 +75,7 @@ RUN bun install --filter database --production --no-cache --frozen-lockfile
##################################################################################
# PRODUCTION IMAGE ###############################################################
##################################################################################
FROM base as production
FROM bun-base as production
COPY --chown=app:app --from=build-shared ${DOCKER_WORKDIR}/shared/build ./shared/build
COPY --chown=app:app --from=build-shared ${DOCKER_WORKDIR}/shared/package.json ./shared/package.json
@ -89,7 +89,7 @@ COPY --chown=app:app --from=build ${DOCKER_WORKDIR}/package.json ./package.json
FROM production as up
# Run command
CMD /bin/sh -c "cd database && yarn up"
CMD /bin/sh -c "cd database && bun run up"
##################################################################################
# TEST RESET #####################################################################
@ -97,7 +97,7 @@ CMD /bin/sh -c "cd database && yarn up"
FROM production as reset
# Run command
CMD /bin/sh -c "cd database && yarn reset"
CMD /bin/sh -c "cd database && bun run reset"
##################################################################################
# TEST DOWN ######################################################################
@ -105,4 +105,4 @@ CMD /bin/sh -c "cd database && yarn reset"
FROM production as down
# Run command
CMD /bin/sh -c "cd database && yarn down"
CMD /bin/sh -c "cd database && bun run down"

View File

@ -23,20 +23,20 @@ TypeError: undefined is not an object (evaluating 'module.parent.parent.require'
## Upgrade migrations
```bash
yarn up
turbo up
```
## Downgrade migrations
```bash
yarn down
turbo down
```
## Reset database
```bash
yarn reset
turbo reset
```
Runs all down migrations and after this all up migrations.
@ -45,7 +45,7 @@ Runs all down migrations and after this all up migrations.
call truncate for all tables
```bash
yarn clear
turbo clearDB
```

View File

@ -57,7 +57,6 @@
"dotenv": "^17.2.3",
"esbuild": "^0.25.2",
"geojson": "^0.5.0",
"joi-extract-type": "^15.0.8",
"log4js": "^6.9.1",
"mysql": "^2.18.1",
"mysql2": "^2.3.0",

View File

@ -4,6 +4,9 @@
"clear": {
"cache": false
},
"clearDB": {
"cache": false
},
"up:backend_test": {
"cache": false
},

View File

@ -41,7 +41,7 @@ mysql -u ${DB_USER} -p${DB_PASSWORD} <<EOFMYSQL
EOFMYSQL
# Update database if needed (use dev_up for seeding setups)
yarn --cwd $PROJECT_ROOT/database up
turbo up
# Start gradido-backend service
pm2 start gradido-backend

View File

@ -34,7 +34,6 @@
"@swc/jest": "^0.2.38",
"@types/dotenv": "^8.2.3",
"@types/jest": "27.5.1",
"@types/joi": "^17.2.3",
"@types/node": "^17.0.45",
"@types/uuid": "^8.3.4",
"config-schema": "*",
@ -42,7 +41,7 @@
"dotenv": "^17.2.3",
"esbuild": "^0.25.3",
"jest": "27.5.1",
"joi": "^17.13.3",
"joi": "17.13.3",
"log4js": "^6.9.1",
"nodemon": "^2.0.7",
"prettier": "^2.8.8",

View File

@ -57,7 +57,7 @@
"graphql-tag": "^2.12.6",
"helmet": "^7.1.0",
"jest": "27.2.4",
"joi": "^17.13.3",
"joi": "17.13.3",
"lodash.clonedeep": "^4.5.0",
"log4js": "^6.7.1",
"nodemon": "^2.0.7",

View File

@ -7,26 +7,54 @@ Then install grass, it need some time, because it will be compiled.
```bash
cargo install grass
```
Now with using yarn compile-sass or turbo compile-sass grass will be used.
Now with using bun compile-sass or turbo compile-sass grass will be used.
## install mit yarn
```bash
cd frontend
yarn install
yarn run serve
# build
yarn run build
### Compiles and hot-reloads for development
```
turbo dev
```
or from root folder:
```
turbo frontend#dev
```
## install mit docker
```bash
# build
docker build -t gradido-frontend .
### Compiles and minifies for production
```
turbo build
```
or from root folder:
# run
docker run -it -p 80:80 --rm gradido-frontend
```
turbo frontend#build
```
### Lints and fixes files
```
turbo lint
```
or from root folder:
```
turbo frontend#lint
```
### Unit tests
```
turbo test
```
For filtering out single tests:
```
turbo test -- <test_name>
```
Everything after -- will be passed to vitest.
or from root folder:
```
turbo frontend#test
```
**Fully Coded Components**

View File

@ -97,7 +97,7 @@
"eslint-plugin-vitest": "^0.5.4",
"eslint-plugin-vue": "8.7.1",
"eslint-webpack-plugin": "^5.0.0",
"joi": "^17.13.3",
"joi": "17.13.3",
"jsdom": "^25.0.0",
"lightningcss": "^1.30.1",
"mock-apollo-client": "^1.2.1",

View File

@ -7,7 +7,7 @@
"author": "Gradido Academy - https://www.gradido.net",
"license": "Apache-2.0",
"private": true,
"packageManager": "yarn@1.22.22",
"packageManager": "bun@1.2.0",
"workspaces": [
"admin",
"backend",
@ -20,8 +20,9 @@
"shared"
],
"scripts": {
"release": "scripts/release.sh",
"installAll": "yarn install",
"release": "bumpp --no-commit --no-push -r",
"version": "auto-changelog -p && git add CHANGELOG.md",
"installAll": "bun run install",
"docker": "cross-env BUILD_COMMIT=$(git rev-parse HEAD) docker compose -f docker-compose.yml up",
"docker:rebuild": "cross-env BUILD_COMMIT=$(git rev-parse HEAD) docker compose -f docker-compose.yml build",
"docker_dev": "cross-env BUILD_COMMIT=$(git rev-parse HEAD) docker compose up",
@ -36,7 +37,8 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@biomejs/biome": "2.0.0"
"@biomejs/biome": "2.0.0",
"@types/minimatch": "6.0.0"
},
"engines": {
"node": ">=18"

View File

@ -1,50 +0,0 @@
#!/bin/bash
# find directories
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT_DIR="${SCRIPT_DIR}/../"
FRONTEND_DIR="${PROJECT_DIR}/frontend/"
BACKEND_DIR="${PROJECT_DIR}/backend/"
DATABASE_DIR="${PROJECT_DIR}/database/"
SHARED_DIR="${PROJECT_DIR}/shared/"
CONFIG_SCHEMA_DIR="${PROJECT_DIR}/config-schema/"
CORE_DIR="${PROJECT_DIR}/core/"
ADMIN_DIR="${PROJECT_DIR}/admin/"
DHTNODE_DIR="${PROJECT_DIR}/dht-node/"
FEDERATION_DIR="${PROJECT_DIR}/federation/"
DLTCONNECTOR_DIR="${PROJECT_DIR}/dlt-connector/"
# navigate to project directory
cd ${PROJECT_DIR}
# ask for new version
yarn version --no-git-tag-version --no-commit-hooks --no-commit
# find new version
VERSION="$(node -p -e "require('./package.json').version")"
# update version in sub projects
cd ${FRONTEND_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${BACKEND_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${DATABASE_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${SHARED_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${CONFIG_SCHEMA_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${CORE_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${ADMIN_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${DHTNODE_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${FEDERATION_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
cd ${DLTCONNECTOR_DIR}
yarn version --no-git-tag-version --no-commit-hooks --no-commit --new-version ${VERSION}
# generate changelog
cd ${PROJECT_DIR}
./node_modules/.bin/auto-changelog --commit-limit 0 --latest-version ${VERSION}

View File

@ -26,6 +26,7 @@
},
"devDependencies": {
"@biomejs/biome": "2.0.0",
"@types/minimatch": "6.0.0",
"@types/node": "^17.0.21",
"@types/uuid": "^10.0.0",
"typescript": "^4.9.5",

View File

@ -47,7 +47,8 @@
// "baseUrl": ".", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [".", "../database"], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
/* List of folders to include type definitions from. */
"typeRoots": ["./node_modules/@types", "../node_modules/@types"],
// "types": ["bun-types"], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */

12998
yarn.lock

File diff suppressed because it is too large Load Diff