Skip to content

Commit a894fd8

Browse files
committed
Merge branch 'andrius/switch-pnpm' into 'main'
chore: switch from yarn to pnpm, update Node to lts/24 See merge request flarenetwork/ftso/ftso-scaling!172
2 parents 38f1cfe + 075f5a9 commit a894fd8

32 files changed

+8837
-7161
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
!package.json
77
!tsconfig.build.json
88
!tsconfig.json
9-
!yarn.lock
9+
!pnpm-lock.yaml

.gitlab-ci.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,31 @@ workflow:
44
when: never
55
- when: always
66

7-
lint:
8-
stage: test
9-
image: node:22
7+
.node_pnpm_job:
8+
image: node:24
109
cache:
1110
- key:
1211
files:
13-
- yarn.lock
12+
- pnpm-lock.yaml
1413
paths:
1514
- node_modules
16-
- .yarn-cache
15+
- .pnpm-store
1716
policy: pull-push
1817
before_script:
19-
- yarn install --frozen-lockfile --cache-folder .yarn-cache
18+
- corepack enable
19+
- corepack prepare "$(node -p "require('./package.json').packageManager")" --activate
20+
- pnpm config set store-dir .pnpm-store
21+
- pnpm install --frozen-lockfile
22+
23+
lint:
24+
extends: .node_pnpm_job
25+
stage: test
2026
script:
2127
- |
2228
set +e # don't stop on first failure
23-
yarn lint:check
29+
pnpm lint:check
2430
LINT_EXIT=$?
25-
yarn format:check
31+
pnpm format:check
2632
FORMAT_EXIT=$?
2733
set -e
2834
@@ -32,24 +38,14 @@ lint:
3238
fi
3339
3440
test-all:
41+
extends: .node_pnpm_job
3542
stage: test
3643
needs: []
37-
image: node:22
38-
cache:
39-
- key:
40-
files:
41-
- yarn.lock
42-
paths:
43-
- node_modules
44-
- .yarn-cache
45-
policy: pull-push
46-
before_script:
47-
- yarn install --frozen-lockfile --cache-folder .yarn-cache
4844
script:
49-
- yarn test:all
45+
- pnpm test:all
5046

5147
# TODO: enable coverage reports
5248
# test-coverage:
5349
# extends: test-all
5450
# script:
55-
# - yarn test:coverage
51+
# - pnpm test:coverage

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.16
1+
v24.13.1

.vscode/launch.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"program": "${file}",
1313
// "preLaunchTask": "tsc: build - tsconfig.json",
1414
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
15-
"runtimeExecutable": "yarn",
15+
"runtimeExecutable": "pnpm",
1616
"runtimeArgs": ["start:debug"]
1717
},
1818

@@ -28,21 +28,21 @@
2828
"type": "node",
2929
"request": "launch",
3030
"name": "Test FTSO reward logic",
31-
"runtimeExecutable": "yarn",
31+
"runtimeExecutable": "pnpm",
3232
"runtimeArgs": ["test", "test/libs/unit/generator-rewards.test.ts"]
3333
},
3434
{
3535
"type": "node",
3636
"request": "launch",
3737
"name": "Test Integration",
38-
"runtimeExecutable": "yarn",
38+
"runtimeExecutable": "pnpm",
3939
"runtimeArgs": ["test:integration"]
4040
},
4141
{
4242
"type": "node",
4343
"request": "launch",
4444
"name": "Test basic generation",
45-
"runtimeExecutable": "yarn",
45+
"runtimeExecutable": "pnpm",
4646
"env": {
4747
"NETWORK": "local-test"
4848
},
@@ -52,7 +52,7 @@
5252
"type": "node",
5353
"request": "launch",
5454
"name": "Calculation process",
55-
"runtimeExecutable": "yarn",
55+
"runtimeExecutable": "pnpm",
5656
"env": {
5757
"NETWORK": "from-env",
5858
"FTSO_CA_FTSO_SYSTEMS_MANAGER_ADDRESS": "0xa4bcDF64Cdd5451b6ac3743B414124A6299B65FF",

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16-
- ...
17-
16+
- Switched from Yarn to pnpm package manager
17+
- Updated Dockerfile to only include `ftso-data-provider` and start it automatically.
18+
No need to pass an extra command to the container anymore.
1819

1920
## [1.0.5] - 2026-02-19
2021

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ also welcome.
2929
Prerequisites:
3030

3131
- Node.js, as specified in the `.nvmrc` file. We recommend using `nvm` to manage versions.
32-
- Yarn 1.22.x
32+
- pnpm 10.28.x
3333
- Git
3434

3535
Install the dependencies:
3636

3737
```bash
38-
$ yarn install
38+
$ pnpm install
3939
```
4040

4141
### Configuration
@@ -49,42 +49,42 @@ To start the app run:
4949

5050
```bash
5151
# development
52-
$ yarn run start
52+
$ pnpm run start
5353

5454
# watch mode
55-
$ yarn run start:dev
55+
$ pnpm run start:dev
5656
```
5757

5858
### Testing
5959

6060
To run all tests or check code coverage, use the following commands:
6161
```bash
62-
yarn test:all
63-
yarn test:coverage
62+
pnpm test:all
63+
pnpm test:coverage
6464
```
6565
### Linting and formatting
6666

6767
We use ESLint and Prettier:
6868
- Check lint:
6969

7070
```bash
71-
yarn lint:check
71+
pnpm lint:check
7272
```
7373

7474
- Auto-fix lint issues:
7575

7676
```bash
77-
yarn lint:fix
77+
pnpm lint:fix
7878
```
7979

8080
- Check formatting:
8181

8282
```bash
83-
yarn format:check
83+
pnpm format:check
8484
```
8585

8686
- Auto-format:
8787

8888
```bash
89-
yarn format:fix
90-
```
89+
pnpm format:fix
90+
```

Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
FROM node:22-slim@sha256:4a4884e8a44826194dff92ba316264f392056cbe243dcc9fd3551e71cea02b90 AS nodemodules
1+
FROM node:24-slim@sha256:bf22df20270b654c4e9da59d8d4a3516cce6ba2852e159b27288d645b7a7eedc AS base
22

33
WORKDIR /app
44

5-
COPY package.json yarn.lock ./
6-
RUN yarn install --frozen-lockfile --network-timeout 100000
5+
RUN corepack enable
6+
COPY package.json pnpm-lock.yaml ./
77

8-
FROM node:22-slim@sha256:4a4884e8a44826194dff92ba316264f392056cbe243dcc9fd3551e71cea02b90 AS build
8+
FROM base AS nodemodules
9+
RUN corepack prepare "$(node -p "require('./package.json').packageManager")" --activate && \
10+
pnpm install --frozen-lockfile --ignore-scripts
11+
12+
FROM base AS build
913

1014
WORKDIR /app
1115

1216
COPY --from=nodemodules /app/node_modules /app/node_modules
1317
COPY . ./
1418

15-
RUN yarn build
16-
RUN yarn build ftso-reward-calculation-process
19+
RUN pnpm exec nest build ftso-data-provider
1720

18-
FROM node:22-slim@sha256:4a4884e8a44826194dff92ba316264f392056cbe243dcc9fd3551e71cea02b90 AS runtime
21+
FROM node:24-slim@sha256:bf22df20270b654c4e9da59d8d4a3516cce6ba2852e159b27288d645b7a7eedc AS runtime
1922

2023
WORKDIR /app
2124

@@ -24,5 +27,4 @@ COPY --from=build /app/dist /app/dist
2427

2528
COPY . .
2629

27-
CMD ["bash"]
28-
30+
CMD ["node", "dist/apps/ftso-data-provider/src/main.js"]

apps/ftso-data-provider/tsconfig.app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"declaration": false,
5-
"outDir": "../../dist/apps/ftso-data-provider"
5+
"outDir": "../../dist"
66
},
77
"include": ["src/**/*"],
88
"exclude": ["node_modules", "dist", "test", "**/*spec.ts", "old"]

apps/ftso-reward-calculation-process/src/ftso-reward-calculation-process.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const IMPORTS_ARRAY = [
1818
const sqliteDatabase: string = configService.get("db_sqlite3_path");
1919
if (sqliteDatabase) {
2020
return {
21-
type: "sqlite",
21+
type: "better-sqlite3",
2222
database: sqliteDatabase,
2323
entities: [TLPTransaction, TLPEvents, TLPState],
2424
synchronize: false,
25-
flags: 1,
25+
readonly: true,
2626
// logging: true,
2727
};
2828
}

apps/ftso-reward-calculation-process/tsconfig.app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"declaration": false,
5-
"outDir": "../../dist/apps/ftso-reward-calculation-process"
5+
"outDir": "../../dist"
66
},
77
"include": ["src/**/*"],
88
"exclude": ["node_modules", "dist", "test", "**/*spec.ts"]

0 commit comments

Comments
 (0)