mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
switch to bun as turbo packet manager, at last since turbo now support bun, remove yarn from everywhere
This commit is contained in:
parent
e06f6a629e
commit
7ae22cbbe5
4
.github/workflows/test_config.yml
vendored
4
.github/workflows/test_config.yml
vendored
@ -36,8 +36,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
|
||||
|
||||
|
||||
4
.github/workflows/test_frontend.yml
vendored
4
.github/workflows/test_frontend.yml
vendored
@ -57,7 +57,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'
|
||||
@ -108,4 +108,4 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Frontend | Locales
|
||||
run: cd frontend && yarn locales
|
||||
run: cd frontend && bun run locales
|
||||
|
||||
4
.github/workflows/test_shared.yml
vendored
4
.github/workflows/test_shared.yml
vendored
@ -35,8 +35,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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
29
README.md
29
README.md
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
```
|
||||
|
||||
@ -71,7 +71,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",
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
## Seed DB
|
||||
|
||||
```bash
|
||||
yarn seed
|
||||
turbo seed
|
||||
```
|
||||
|
||||
Deletes all data in database. Then seeds data in database.
|
||||
|
||||
@ -75,7 +75,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",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
```
|
||||
|
||||
|
||||
|
||||
@ -56,7 +56,6 @@
|
||||
"dotenv": "^10.0.0",
|
||||
"esbuild": "^0.25.2",
|
||||
"geojson": "^0.5.0",
|
||||
"joi-extract-type": "^15.0.8",
|
||||
"log4js": "^6.9.1",
|
||||
"mysql2": "^2.3.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
|
||||
@ -4,6 +4,9 @@
|
||||
"clear": {
|
||||
"cache": false
|
||||
},
|
||||
"clearDB": {
|
||||
"cache": false
|
||||
},
|
||||
"up:backend_test": {
|
||||
"cache": false
|
||||
},
|
||||
|
||||
@ -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": "10.0.0",
|
||||
"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",
|
||||
|
||||
@ -55,7 +55,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",
|
||||
|
||||
@ -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**
|
||||
|
||||
@ -96,7 +96,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",
|
||||
|
||||
@ -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",
|
||||
@ -21,7 +21,7 @@
|
||||
],
|
||||
"scripts": {
|
||||
"release": "scripts/release.sh",
|
||||
"installAll": "yarn install",
|
||||
"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 +36,8 @@
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "2.0.0"
|
||||
"@biomejs/biome": "2.0.0",
|
||||
"@types/minimatch": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
// "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. */
|
||||
"typeRoots": ["./node_modules/@types", "../node_modules/@types"], /* List of folders to include type definitions from. */
|
||||
// "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'. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user