Files
nixpkgs/pkgs/by-name/wa/warpgate/web-ui-package-json.patch
Ihar Hrachyshka da7b2a24fa warpgate: fix build with openapi-generator 7.24
openapi-generator-cli removed "moduleResolution": "node" from the
generated typescript-fetch tsconfig. With Warpgate's config, TypeScript
then fails to find Node packages and directory imports.

Pass Node resolution explicitly when compiling each generated client.
Compile both CommonJS and ES module outputs, since the generated package
advertises both and Vite selects the ES module entry.

d70d82a3ee

Assisted-by: Codex gpt-5.6-sol xhigh
2026-07-28 23:02:26 -04:00

16 lines
2.3 KiB
Diff

diff --git a/package.json b/package.json
index 0f1d768..c070a59 100644
--- a/package.json
+++ b/package.json
@@ -12,8 +12,8 @@
"postinstall": "npm run openapi:client:gateway && npm run openapi:client:admin",
"openapi:schema:gateway": "cargo run -p warpgate-protocol-http > src/gateway/lib/openapi-schema.json",
"openapi:schema:admin": "cargo run -p warpgate-admin > src/admin/lib/openapi-schema.json",
- "openapi:client:gateway": "openapi-generator-cli generate -g typescript-fetch -i src/gateway/lib/openapi-schema.json -o src/gateway/lib/api-client -p npmName=warpgate-gateway-api-client -p useSingleRequestParameter=true && cd src/gateway/lib/api-client && npm i typescript@5 && npm i && npx tsc --target esnext --module esnext && rm -rf src tsconfig.json",
- "openapi:client:admin": "openapi-generator-cli generate -g typescript-fetch -i src/admin/lib/openapi-schema.json -o src/admin/lib/api-client -p npmName=warpgate-admin-api-client -p useSingleRequestParameter=true && cd src/admin/lib/api-client && npm i typescript@5 && npm i && npx tsc --target esnext --module esnext && rm -rf src tsconfig.json",
+ "openapi:client:gateway": "openapi-generator-cli generate -g typescript-fetch -i src/gateway/lib/openapi-schema.json -o src/gateway/lib/api-client -p npmName=warpgate-gateway-api-client -p useSingleRequestParameter=true && ln -sr node_modules src/gateway/lib/api-client/node_modules && cd src/gateway/lib/api-client && npx tsc --target esnext --moduleResolution node && npx tsc -p tsconfig.esm.json --target esnext --moduleResolution node && rm -rf src tsconfig.json tsconfig.esm.json",
+ "openapi:client:admin": "openapi-generator-cli generate -g typescript-fetch -i src/admin/lib/openapi-schema.json -o src/admin/lib/api-client -p npmName=warpgate-admin-api-client -p useSingleRequestParameter=true && ln -sr node_modules src/admin/lib/api-client/node_modules && cd src/admin/lib/api-client && npx tsc --target esnext --moduleResolution node && npx tsc -p tsconfig.esm.json --target esnext --moduleResolution node && rm -rf src tsconfig.json tsconfig.esm.json",
"openapi:tests-sdk": "openapi-generator-cli generate -g python -i src/admin/lib/openapi-schema.json -o ../tests/api_sdk",
"openapi": "npm run openapi:schema:admin && npm run openapi:schema:gateway && npm run openapi:client:admin && npm run openapi:client:gateway"
},