root: upgrade to openapi generator v6
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
20262f3f4b
commit
4a6c46a5c9
5
Makefile
5
Makefile
|
@ -56,13 +56,12 @@ gen-web:
|
||||||
docker run \
|
docker run \
|
||||||
--rm -v ${PWD}:/local \
|
--rm -v ${PWD}:/local \
|
||||||
--user ${UID}:${GID} \
|
--user ${UID}:${GID} \
|
||||||
openapitools/openapi-generator-cli:v5.4.0 generate \
|
openapitools/openapi-generator-cli:v6.0.0-beta generate \
|
||||||
-i /local/schema.yml \
|
-i /local/schema.yml \
|
||||||
-g typescript-fetch \
|
-g typescript-fetch \
|
||||||
-o /local/web-api \
|
-o /local/web-api \
|
||||||
--additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=@goauthentik/api,npmVersion=${NPM_VERSION}
|
--additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=@goauthentik/api,npmVersion=${NPM_VERSION}
|
||||||
mkdir -p web/node_modules/@goauthentik/api
|
mkdir -p web/node_modules/@goauthentik/api
|
||||||
python -m scripts.web_api_esm
|
|
||||||
\cp -fv scripts/web_api_readme.md web-api/README.md
|
\cp -fv scripts/web_api_readme.md web-api/README.md
|
||||||
cd web-api && npm i
|
cd web-api && npm i
|
||||||
\cp -rfv web-api/* web/node_modules/@goauthentik/api
|
\cp -rfv web-api/* web/node_modules/@goauthentik/api
|
||||||
|
@ -75,7 +74,7 @@ gen-outpost:
|
||||||
docker run \
|
docker run \
|
||||||
--rm -v ${PWD}:/local \
|
--rm -v ${PWD}:/local \
|
||||||
--user ${UID}:${GID} \
|
--user ${UID}:${GID} \
|
||||||
openapitools/openapi-generator-cli:v5.2.1 generate \
|
openapitools/openapi-generator-cli:v6.0.0-beta generate \
|
||||||
-i /local/schema.yml \
|
-i /local/schema.yml \
|
||||||
-g go \
|
-g go \
|
||||||
-o /local/api \
|
-o /local/api \
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
"""Enable ESM Modules for generated Web API"""
|
|
||||||
from json import loads, dumps
|
|
||||||
|
|
||||||
TSCONFIG_ESM = {
|
|
||||||
"compilerOptions": {
|
|
||||||
"declaration": True,
|
|
||||||
"target": "es6",
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"outDir": "./dist/esm",
|
|
||||||
"typeRoots": ["node_modules/@types"],
|
|
||||||
},
|
|
||||||
"exclude": ["dist", "node_modules"],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
with open("web-api/package.json", encoding="utf-8") as _package:
|
|
||||||
package = loads(_package.read())
|
|
||||||
package["license"] = "GPL-3.0-only"
|
|
||||||
package["module"] = "./dist/esm/index.js"
|
|
||||||
package["sideEffects"] = False
|
|
||||||
package["scripts"]["build"] = "tsc && tsc --project tsconfig.esm.json"
|
|
||||||
|
|
||||||
open("web-api/package.json", "w+", encoding="utf-8").write(dumps(package))
|
|
||||||
open("web-api/tsconfig.esm.json", "w+", encoding="utf-8").write(dumps(TSCONFIG_ESM))
|
|
Reference in New Issue