Skip to content

Commit c8e3f3f

Browse files
authored
chore(deps): migrate to pnpm catalog and upgrade (#389)
1 parent 53f2f87 commit c8e3f3f

38 files changed

Lines changed: 1040 additions & 1217 deletions

.github/workflows/lint.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Lint
2+
permissions:
3+
contents: read
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: "lts/*"
19+
- uses: pnpm/action-setup@v4
20+
- name: Install dependencies
21+
run: pnpm install
22+
23+
- name: Lint
24+
run: pnpm exec nx run-many --target=lint --all --skip-nx-cache

.github/workflows/typecheck.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ on:
99
branches:
1010
- main
1111
jobs:
12-
test:
12+
typecheck:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
1616
- uses: actions/setup-node@v4
1717
with:
18-
node-version: 'lts/*'
18+
node-version: "lts/*"
1919
- uses: pnpm/action-setup@v4
2020
- name: Install dependencies
2121
run: pnpm install
2222

23-
- name: Run TypeScript Type Check
24-
run: npx nx run-many --target=typecheck --all --skip-nx-cache
25-
23+
- name: Typecheck
24+
run: pnpm exec nx run-many --target=typecheck --all --skip-nx-cache

apps/cli/package.json

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,38 @@
77
"@api7/adc-converter-openapi": "workspace:*",
88
"@api7/adc-differ": "workspace:*",
99
"@types/express": "^5.0.3",
10+
"@types/js-yaml": "^4.0.9",
11+
"@types/lodash": "catalog:",
1012
"@types/supertest": "^6.0.3",
13+
"@types/pluralize": "^0.0.33",
14+
"@types/qs": "^6.9.15",
15+
"@types/signale": "^1.4.7",
16+
"@types/semver": "catalog:",
1117
"supertest": "^7.1.4",
12-
"vitest": "^3.0.0",
13-
"@nx/webpack": "21.6.4",
18+
"vitest": "catalog:",
1419
"webpack": "5.101.3",
15-
"terser-webpack-plugin": "^5.3.14"
20+
"terser-webpack-plugin": "^5.3.14",
21+
"semver": "catalog:"
1622
},
1723
"dependencies": {
24+
"@api7/adc-sdk": "workspace:*",
1825
"express": "^5.1.0",
1926
"winston": "^3.17.0",
20-
"axios": "^1.13.1",
21-
"rxjs": "^7.8.1",
27+
"axios": "catalog:",
28+
"rxjs": "catalog:",
29+
"lodash": "catalog:",
30+
"zod": "catalog:",
2231
"pluralize": "^8.0.0",
23-
"listr2": "^8.2.1",
32+
"listr2": "catalog:",
2433
"commander": "^13.1.0",
25-
"js-yaml": "^4.1.0",
26-
"lodash": "^4.17.21",
2734
"chalk": "^4.1.2",
2835
"parse-duration": "^1.1.0",
2936
"qs": "^6.12.1",
3037
"dotenv": "^16.4.5",
31-
"zod": "^4.0.10",
3238
"source-map-support": "^0.5.21",
3339
"agentkeepalive": "^4.6.0",
34-
"glob": "^11.0.3",
3540
"signale": "^1.4.0",
36-
"@api7/adc-sdk": "workspace:*"
41+
"glob": "^13.0.0",
42+
"js-yaml": "catalog:"
3743
}
3844
}

apps/cli/project.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,15 @@
77
"targets": {
88
"build": {
99
"executor": "@nx/webpack:webpack",
10-
"outputs": [
11-
"{options.outputPath}"
12-
],
10+
"outputs": ["{options.outputPath}"],
1311
"defaultConfiguration": "production",
1412
"options": {
1513
"target": "node",
1614
"compiler": "tsc",
1715
"outputPath": "dist/apps/cli",
1816
"main": "apps/cli/src/main.ts",
1917
"tsConfig": "apps/cli/tsconfig.app.json",
20-
"assets": [
21-
"apps/cli/src/assets"
22-
],
18+
"assets": ["apps/cli/src/assets"],
2319
"webpackConfig": "apps/cli/webpack.config.js",
2420
"sourceMap": true
2521
},
@@ -30,12 +26,10 @@
3026
},
3127
"lint": {
3228
"executor": "@nx/eslint:lint",
33-
"outputs": [
34-
"{options.outputFile}"
35-
]
29+
"outputs": ["{options.outputFile}"]
3630
},
3731
"test": {
38-
"executor": "@nx/vite:test",
32+
"executor": "@nx/vitest:test",
3933
"options": {
4034
"configFile": "apps/cli/vitest.config.ts"
4135
}

apps/cli/tsconfig.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,6 @@
33
"files": [],
44
"include": [],
55
"references": [
6-
{
7-
"path": "../../libs/differ"
8-
},
9-
{
10-
"path": "../../libs/converter-openapi"
11-
},
12-
{
13-
"path": "../../libs/backend-apisix-standalone"
14-
},
15-
{
16-
"path": "../../libs/backend-apisix"
17-
},
18-
{
19-
"path": "../../libs/backend-api7"
20-
},
21-
{
22-
"path": "../../libs/sdk"
23-
},
246
{
257
"path": "./tsconfig.app.json"
268
},

apps/cli/tsconfig.spec.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"types": [
66
"vitest/globals",
77
"vitest/importMeta",
8-
"vite/client",
98
"node",
109
"vitest"
1110
]

libs/backend-api7/e2e/support/utils.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
11
import * as ADCSDK from '@api7/adc-sdk';
2-
import { Listr, SilentRenderer } from 'listr2';
32
import { Agent as httpsAgent } from 'node:https';
43
import { lastValueFrom, toArray } from 'rxjs';
54
import * as semver from 'semver';
65

76
import { BackendAPI7 } from '../../src';
87

9-
export const runTask = async (tasks: Listr, ctx = {}) => {
10-
// add sync delay
11-
if (Array.isArray(tasks.task)) {
12-
const delayedTasks = tasks.task.reduce((pv, cv) => {
13-
pv.push(cv, {
14-
task: async () => new Promise((resolve) => setTimeout(resolve, 20)),
15-
});
16-
return pv;
17-
}, []);
18-
tasks = new Listr(delayedTasks, { concurrent: false });
19-
}
20-
21-
//@ts-expect-error just ignore
22-
tasks.renderer = new SilentRenderer();
23-
await tasks.run(ctx);
24-
return tasks.ctx.local;
25-
};
26-
278
export const syncEvents = async (
289
backend: BackendAPI7,
2910
events: Array<ADCSDK.Event> = [],

libs/backend-api7/package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,19 @@
1010
},
1111
"devDependencies": {
1212
"@api7/adc-differ": "workspace:*",
13-
"@api7/adc-sdk": "workspace:*"
13+
"@api7/adc-sdk": "workspace:*",
14+
"@types/lodash": "catalog:",
15+
"@types/semver": "catalog:",
16+
"@types/json-schema": "^7.0.15",
17+
"vitest": "catalog:"
18+
},
19+
"dependencies": {
20+
"axios": "catalog:",
21+
"rxjs": "catalog:",
22+
"lodash": "catalog:",
23+
"tslib": "catalog:",
24+
"semver": "catalog:",
25+
"immer": "catalog:"
1426
},
1527
"nx": {
1628
"name": "backend-api7",
@@ -23,7 +35,7 @@
2335
]
2436
},
2537
"test": {
26-
"executor": "@nx/vite:test",
38+
"executor": "@nx/vitest:test",
2739
"options": {
2840
"configFile": "libs/backend-api7/vitest.config.ts"
2941
}

libs/backend-api7/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as ADCSDK from '@api7/adc-sdk';
22
import axios, { type AxiosInstance } from 'axios';
3-
import { JSONSchema4 } from 'json-schema';
3+
import type { JSONSchema4 } from 'json-schema';
44
import { isEmpty, isNil } from 'lodash';
55
import { Subject, forkJoin, from, switchMap } from 'rxjs';
66
import semver, { SemVer } from 'semver';

libs/backend-api7/tsconfig.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
"files": [],
44
"include": [],
55
"references": [
6-
{
7-
"path": "../differ"
8-
},
9-
{
10-
"path": "../sdk"
11-
},
126
{
137
"path": "./tsconfig.lib.json"
148
},

0 commit comments

Comments
 (0)