@team-supercharge/oasg 19.0.1 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +3 -3
- package/targets/angular/templates/package.mustache +40 -0
- package/targets/common.sh +8 -0
- package/targets/nestjs/templates/package.mustache +7 -3
- package/targets/react/templates/hook.mustache +0 -1
- package/targets/react/templates/package.mustache +2 -2
- package/targets/stubby/Dockerfile +1 -1
- package/targets/typescript-axios/templates/package.mustache +41 -0
package/README.md
CHANGED
|
@@ -231,6 +231,30 @@ This command is offered for `npm` based projects only to ensure that a working `
|
|
|
231
231
|
$ npx oasg save-lock [target]
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
+
## Dependency install cooldown
|
|
235
|
+
|
|
236
|
+
`npm install` only resolves package versions that have been on the registry for at least 7 days, so a
|
|
237
|
+
compromised release has a week to be caught and unpublished before it can reach a build. This is the
|
|
238
|
+
`NPM_CONFIG_MIN_RELEASE_AGE` npm setting, and it applies in two places:
|
|
239
|
+
|
|
240
|
+
* the _OASg_ image sets it for its own dependencies and CLI installs
|
|
241
|
+
* the target scripts set it for the installs the `npm` based targets (`angular`, `nestjs`, `msw`,
|
|
242
|
+
`react`, `contract-testing`, `typescript-axios`, `typescript-fetch`) perform while building the
|
|
243
|
+
generated SDK, so the cooldown holds even when _OASg_ runs outside its own image
|
|
244
|
+
|
|
245
|
+
`npm ci` is unaffected by design: it installs exactly what the lock file pins, which is what
|
|
246
|
+
[`save-lock`](#save-lock) is for.
|
|
247
|
+
|
|
248
|
+
If a target has to pick up a fresher release (a framework version published within the cooldown, for
|
|
249
|
+
example), override the variable on the job:
|
|
250
|
+
|
|
251
|
+
```yaml
|
|
252
|
+
generate-sdk:
|
|
253
|
+
extends: .oasg
|
|
254
|
+
variables:
|
|
255
|
+
NPM_CONFIG_MIN_RELEASE_AGE: "0"
|
|
256
|
+
```
|
|
257
|
+
|
|
234
258
|
---
|
|
235
259
|
|
|
236
260
|
# Linter Rules
|
|
@@ -1539,6 +1563,37 @@ setupWorker(
|
|
|
1539
1563
|
|
|
1540
1564
|
This section covers the breaking changes and their migrations across major version upgrades.
|
|
1541
1565
|
|
|
1566
|
+
## From `19.x.x` to `20.0.0`
|
|
1567
|
+
|
|
1568
|
+
From this version _OASg_ requires `node` version `>=24.21` (the current LTS line) and `npm` version
|
|
1569
|
+
`>=11` by default. `node@20` reached its end of life, so please upgrade your projects accordingly.
|
|
1570
|
+
|
|
1571
|
+
The `stubby` target's generated `Dockerfile` is based on `node:24.21.0-alpine` as well.
|
|
1572
|
+
|
|
1573
|
+
A 7 day [dependency install cooldown](#dependency-install-cooldown) now applies to every
|
|
1574
|
+
`npm install` _OASg_ runs, including the ones the `npm` based targets perform while building the
|
|
1575
|
+
generated SDK. A target that must pick up a release younger than that needs
|
|
1576
|
+
`NPM_CONFIG_MIN_RELEASE_AGE: "0"` on its job.
|
|
1577
|
+
|
|
1578
|
+
### Peer dependencies in the `npm` based targets
|
|
1579
|
+
|
|
1580
|
+
Framework packages that belong to the consuming application are declared as `peerDependencies`
|
|
1581
|
+
instead of being pinned by the generated SDK, so the application decides which version is used:
|
|
1582
|
+
|
|
1583
|
+
* `typescript-axios`: `axios` moved from `dependencies` to `peerDependencies` (`^1.6.1`).
|
|
1584
|
+
Applications that relied on the SDK to pull `axios` in have to depend on it themselves.
|
|
1585
|
+
* `angular`: `@angular/common` is declared as a peer next to `@angular/core` and `rxjs`, as the
|
|
1586
|
+
generated services import `HttpClient` from `@angular/common/http`.
|
|
1587
|
+
* `nestjs`: `reflect-metadata` is `^0.2.2` rather than the exact `0.2.2`, `@types/multer` became an
|
|
1588
|
+
optional peer (it is only needed for `binary` payloads), and the pinned `@types/validator` is no
|
|
1589
|
+
longer shipped as a runtime dependency, since `class-validator` already depends on it.
|
|
1590
|
+
* `react`: `@tanstack/react-query` is `^5.90.21` rather than the exact `5.90.21`, so any _React
|
|
1591
|
+
Query_ `5.x` can be used. The generated hooks take `NoInfer` from TypeScript instead of from
|
|
1592
|
+
`@tanstack/react-query`, which stopped re-exporting it in `5.10x`, so they need TypeScript `>=5.4`.
|
|
1593
|
+
|
|
1594
|
+
The `msw` target already declared `msw` as a peer, and `typescript-fetch` has no runtime dependency
|
|
1595
|
+
at all, so neither of them changed.
|
|
1596
|
+
|
|
1542
1597
|
## From `18.x.x` to `19.0.0`
|
|
1543
1598
|
|
|
1544
1599
|
### Breaking in `spring`, `spring-kotlin`, `feign` and `feign-kotlin` targets
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-supercharge/oasg",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0",
|
|
4
4
|
"description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
|
|
5
5
|
"author": "Supercharge",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"url": "git@gitlab.com:team-supercharge/oasg.git"
|
|
16
16
|
},
|
|
17
17
|
"engines": {
|
|
18
|
-
"node": ">=
|
|
19
|
-
"npm": ">=
|
|
18
|
+
"node": ">=24.21",
|
|
19
|
+
"npm": ">=11"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"bin",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{{npmName}}}",
|
|
3
|
+
"version": "{{{npmVersion}}}",
|
|
4
|
+
"description": "OpenAPI client for {{{npmName}}}",
|
|
5
|
+
"author": "OpenAPI-Generator Contributors",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"openapi-client",
|
|
12
|
+
"openapi-generator"
|
|
13
|
+
],
|
|
14
|
+
"license": "{{licenseName}}",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "ng-packagr -p ng-package.json"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@angular/common": "^{{ngVersion}}",
|
|
20
|
+
"@angular/core": "^{{ngVersion}}",
|
|
21
|
+
"rxjs": "^{{rxjsVersion}}"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@angular/common": "^{{ngVersion}}",
|
|
25
|
+
"@angular/compiler": "^{{ngVersion}}",
|
|
26
|
+
"@angular/compiler-cli": "^{{ngVersion}}",
|
|
27
|
+
"@angular/core": "^{{ngVersion}}",
|
|
28
|
+
"@angular/platform-browser": "^{{ngVersion}}",
|
|
29
|
+
"ng-packagr": "^{{ngPackagrVersion}}",
|
|
30
|
+
"reflect-metadata": "^0.1.3",
|
|
31
|
+
"rxjs": "^{{rxjsVersion}}",{{#tsickleVersion}}
|
|
32
|
+
"tsickle": "^{{tsickleVersion}}",{{/tsickleVersion}}
|
|
33
|
+
"typescript": "{{{tsVersion}}}",
|
|
34
|
+
"zone.js": "^{{zonejsVersion}}"
|
|
35
|
+
}{{#npmRepository}},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"registry": "{{{npmRepository}}}"
|
|
38
|
+
}
|
|
39
|
+
{{/npmRepository}}
|
|
40
|
+
}
|
package/targets/common.sh
CHANGED
|
@@ -32,4 +32,12 @@ params=$(jq -r ".targets[] | select(.id == \"$targetId\") | del($blacklist) | to
|
|
|
32
32
|
echo "$params"
|
|
33
33
|
eval $params
|
|
34
34
|
|
|
35
|
+
# Only resolve package versions that have been on the registry for at least a week, so a compromised
|
|
36
|
+
# release has time to be caught and unpublished before it lands in a generated SDK. Every target's
|
|
37
|
+
# `npm install` inherits this, including when OASg runs outside its own image, where the image level
|
|
38
|
+
# default does not apply. Set NPM_CONFIG_MIN_RELEASE_AGE=0 on the job to turn the cooldown off.
|
|
39
|
+
: "${NPM_CONFIG_MIN_RELEASE_AGE:=7}"
|
|
40
|
+
export NPM_CONFIG_MIN_RELEASE_AGE
|
|
41
|
+
echo "npm install cooldown (NPM_CONFIG_MIN_RELEASE_AGE): $NPM_CONFIG_MIN_RELEASE_AGE day(s)"
|
|
42
|
+
|
|
35
43
|
echo -e "=====\n"
|
|
@@ -16,16 +16,20 @@
|
|
|
16
16
|
"@nestjs/common": ">=10.0.0 <12.0.0",
|
|
17
17
|
"@nestjs/core": ">=10.0.0 <12.0.0",
|
|
18
18
|
"@nestjs/platform-express": ">=10.0.0 <12.0.0",
|
|
19
|
+
"@types/multer": "^1.4.7",
|
|
19
20
|
"class-transformer": "^0.5.1",
|
|
20
21
|
"class-validator": "^0.14.0",
|
|
21
|
-
"reflect-metadata": "0.2.2",
|
|
22
|
+
"reflect-metadata": "^0.2.2",
|
|
22
23
|
"rxjs": "^7.2.0"
|
|
23
24
|
},
|
|
24
|
-
"
|
|
25
|
-
"@types/
|
|
25
|
+
"peerDependenciesMeta": {
|
|
26
|
+
"@types/multer": {
|
|
27
|
+
"optional": true
|
|
28
|
+
}
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
31
|
"@types/multer": "^1.4.7",
|
|
32
|
+
"@types/validator": "^13.11.7",
|
|
29
33
|
"typescript": "^5",
|
|
30
34
|
"@types/node": "^20"
|
|
31
35
|
}{{#npmRepository}},
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"redux-ts-simple": "^3.2.0",
|
|
29
29
|
"reselect": "^4.0.0",
|
|
30
30
|
{{/sagasAndRecords}}
|
|
31
|
-
"typescript": "^4
|
|
31
|
+
"typescript": "^5.4",
|
|
32
32
|
"@types/react": "^18.2.24 || ^19.0.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^18.2.0 || ^19.0.0",
|
|
36
|
-
"@tanstack/react-query": "5.90.21"
|
|
36
|
+
"@tanstack/react-query": "^5.90.21"
|
|
37
37
|
}{{#npmRepository}},{{/npmRepository}}
|
|
38
38
|
{{#npmRepository}}
|
|
39
39
|
"publishConfig": {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{npmName}}",
|
|
3
|
+
"version": "{{npmVersion}}",
|
|
4
|
+
"description": "OpenAPI client for {{npmName}}",
|
|
5
|
+
"author": "OpenAPI-Generator Contributors",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"axios",
|
|
12
|
+
"typescript",
|
|
13
|
+
"openapi-client",
|
|
14
|
+
"openapi-generator",
|
|
15
|
+
"{{npmName}}"
|
|
16
|
+
],
|
|
17
|
+
"license": "{{licenseName}}",
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"typings": "./dist/index.d.ts",
|
|
20
|
+
{{#supportsES6}}
|
|
21
|
+
"module": "./dist/esm/index.js",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
{{/supportsES6}}
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc{{#supportsES6}} && tsc -p tsconfig.esm.json{{/supportsES6}}",
|
|
26
|
+
"prepare": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"axios": "{{axiosVersion}}"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "12.11.5 - 12.20.42",
|
|
33
|
+
"axios": "{{axiosVersion}}",
|
|
34
|
+
"typescript": "^4.0 || ^5.0"
|
|
35
|
+
}{{#npmRepository}},{{/npmRepository}}
|
|
36
|
+
{{#npmRepository}}
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"registry": "{{npmRepository}}"
|
|
39
|
+
}
|
|
40
|
+
{{/npmRepository}}
|
|
41
|
+
}
|