diff --git a/Makefile b/Makefile index 8886b57ee..0dfd05916 100644 --- a/Makefile +++ b/Makefile @@ -56,13 +56,12 @@ gen-web: docker run \ --rm -v ${PWD}:/local \ --user ${UID}:${GID} \ - openapitools/openapi-generator-cli:v5.4.0 generate \ + openapitools/openapi-generator-cli:v6.0.0-beta generate \ -i /local/schema.yml \ -g typescript-fetch \ -o /local/web-api \ --additional-properties=typescriptThreePlus=true,supportsES6=true,npmName=@goauthentik/api,npmVersion=${NPM_VERSION} mkdir -p web/node_modules/@goauthentik/api - python -m scripts.web_api_esm \cp -fv scripts/web_api_readme.md web-api/README.md cd web-api && npm i \cp -rfv web-api/* web/node_modules/@goauthentik/api @@ -75,7 +74,7 @@ gen-outpost: docker run \ --rm -v ${PWD}:/local \ --user ${UID}:${GID} \ - openapitools/openapi-generator-cli:v5.2.1 generate \ + openapitools/openapi-generator-cli:v6.0.0-beta generate \ -i /local/schema.yml \ -g go \ -o /local/api \ diff --git a/scripts/web_api_esm.py b/scripts/web_api_esm.py deleted file mode 100644 index f76778067..000000000 --- a/scripts/web_api_esm.py +++ /dev/null @@ -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))