Skip to content

Commit 94aad23

Browse files
committed
feat(json-api-nestjs-sdk): fix after update nx
1 parent 5cdf997 commit 94aad23

File tree

6 files changed

+61
-37
lines changed

6 files changed

+61
-37
lines changed

libs/json-api/json-api-nestjs-sdk/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
"CRUD"
1313
],
1414
"dependencies": {
15-
"tslib": ">2.3.0",
16-
"reflect-metadata": "^0.1.12 || ^0.2.0",
17-
"rxjs": "^7.1.0"
15+
"@klerick/json-api-nestjs-shared": "0.0.0"
16+
},
17+
"peerDependencies": {
18+
"axios": "^1.6.0",
19+
"@angular/common": "^20.0.0",
20+
"@angular/core": "^20.0.0"
1821
},
1922
"exports": {
2023
"./package.json": "./package.json",

libs/json-api/json-api-nestjs-sdk/project.json

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
44
"sourceRoot": "{projectRoot}/src",
55
"projectType": "library",
6-
"tags": ["type:lib", "lib:json-api-nestjs", "lib:json-api-nestjs-sdk", "type:publish"],
6+
"tags": [
7+
"type:lib",
8+
"lib:json-api-nestjs",
9+
"lib:json-api-nestjs-sdk",
10+
"type:publish"
11+
],
12+
"implicitDependencies": [
13+
"json-api-nestjs-shared"
14+
],
715
"targets": {
816
"build-cjs": {
917
"dependsOn": [
@@ -16,23 +24,28 @@
1624
}
1725
],
1826
"executor": "@nx/js:tsc",
19-
"outputs": ["{options.outputPath}"],
27+
"outputs": [
28+
"{options.outputPath}"
29+
],
2030
"options": {
2131
"outputPath": "dist/{projectRoot}/cjs",
2232
"main": "{projectRoot}/src/index.ts",
2333
"tsConfig": "{projectRoot}/tsconfig.lib.json",
24-
"assets": [{
25-
"glob": "*.md",
26-
"input": "{projectRoot}",
27-
"output": "../"
28-
}],
29-
"buildableProjectDepsInPackageJsonType": "peerDependencies",
30-
"generateExportsField": true,
31-
"updateBuildableProjectDepsInPackageJson": true,
34+
"assets": [
35+
{
36+
"glob": "*.md",
37+
"input": "{projectRoot}",
38+
"output": "../"
39+
}
40+
],
41+
"generateExportsField": false,
42+
"updateBuildableProjectDepsInPackageJson": false,
3243
"additionalEntryPoints": [
3344
"{projectRoot}/src/ngModule.ts"
3445
],
35-
"externalBuildTargets": ["build-cjs"]
46+
"externalBuildTargets": [
47+
"build-cjs"
48+
]
3649
}
3750
},
3851
"build-mjs": {
@@ -46,19 +59,20 @@
4659
}
4760
],
4861
"executor": "@nx/js:tsc",
49-
"outputs": ["{options.outputPath}"],
62+
"outputs": [
63+
"{options.outputPath}"
64+
],
5065
"options": {
5166
"outputPath": "dist/{projectRoot}/mjs",
5267
"main": "{projectRoot}/src/index.ts",
5368
"tsConfig": "{projectRoot}/tsconfig-mjs.lib.json",
54-
"assets": [{
55-
"glob": "*.md",
56-
"input": "{projectRoot}",
57-
"output": "../"
58-
}],
59-
"buildableProjectDepsInPackageJsonType": "peerDependencies",
60-
"generateExportsField": true,
61-
"updateBuildableProjectDepsInPackageJson": true,
69+
"assets": [
70+
{
71+
"glob": "*.md",
72+
"input": "{projectRoot}",
73+
"output": "../"
74+
}
75+
],
6276
"additionalEntryPoints": [
6377
"{projectRoot}/src/ngModule.ts"
6478
]
@@ -76,6 +90,14 @@
7690
"command": "cp dist/{projectRoot}/cjs/package.json dist/{projectRoot}/package.json",
7791
"forwardAllArgs": false
7892
},
93+
{
94+
"command": "rm -f dist/{projectRoot}/mjs/package.json",
95+
"forwardAllArgs": false
96+
},
97+
{
98+
"command": "rm -f dist/{projectRoot}/cjs/package.json",
99+
"forwardAllArgs": false
100+
},
79101
{
80102
"command": "node tools/scripts/prepare-package-json.mjs json-api-nestjs-sdk"
81103
},
@@ -102,7 +124,8 @@
102124
"codeCoverage": true,
103125
"coverageReporters": [
104126
"json-summary"
105-
]
127+
],
128+
"tsConfig": "libs/json-api/json-api-nestjs-sdk/tsconfig.spec.json"
106129
}
107130
},
108131
"upload-badge": {
@@ -135,6 +158,5 @@
135158
"build"
136159
]
137160
}
138-
},
139-
"implicitDependencies": ["json-api-nestjs-shared"]
161+
}
140162
}

libs/json-api/json-api-nestjs-sdk/src/lib/utils/adapter-for-axios.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import {
33
ResourceObject,
44
ResourceObjectRelationships,
55
} from '@klerick/json-api-nestjs-shared';
6-
import { Axios, AxiosResponse, Method } from 'axios';
6+
import { AxiosStatic, AxiosResponse, Method } from 'axios';
7+
78
import { Observable } from 'rxjs';
89
import { map } from 'rxjs/operators';
910

@@ -18,7 +19,7 @@ import {
1819
import { ParamObject } from './http-params';
1920

2021
class AxiosHttpClient implements HttpInnerClient {
21-
constructor(private axios: Axios) {}
22+
constructor(private axios: AxiosStatic) {}
2223

2324
private observify<T, R extends AxiosResponse<T>>(
2425
makeRequest: () => Promise<R>,
@@ -164,6 +165,6 @@ class AxiosHttpClient implements HttpInnerClient {
164165
}
165166
}
166167

167-
export function adapterForAxios(axios: Axios): HttpInnerClient {
168+
export function adapterForAxios(axios: AxiosStatic): HttpInnerClient {
168169
return new AxiosHttpClient(axios);
169170
}

libs/json-api/json-api-nestjs-sdk/tsconfig-mjs.lib.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
"declaration": true,
66
"module": "es2015",
77
"target": "ES2022",
8-
"types": [
9-
"node"
10-
]
8+
"types": ["node"],
9+
"moduleResolution": "bundler"
1110
},
12-
"include": [
13-
"src/**/*.ts"
14-
],
11+
"include": ["src/**/*.ts"],
1512
"exclude": [
1613
"jest.config.ts",
1714
"src/**/*.spec.ts",

libs/json-api/json-api-nestjs-sdk/tsconfig.lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"compilerOptions": {
44
"outDir": "../../../dist/out-tsc",
55
"declaration": true,
6-
"types": ["node"]
6+
"types": ["node"],
7+
"target": "es2021"
78
},
89
"include": ["src/**/*.ts"],
910
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]

libs/json-api/json-api-nestjs-sdk/tsconfig.spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../../../dist/out-tsc",
55
"module": "commonjs",
6-
"moduleResolution": "node10",
6+
"moduleResolution": "bundler",
77
"types": ["jest", "node"],
88
"paths": {
99
"@klerick/json-api-nestjs-shared": [

0 commit comments

Comments
 (0)