-
-
Notifications
You must be signed in to change notification settings - Fork 305
feat: update openapi-typescript from v4.0.2 to v5.4.2 #3264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpdated package scripts and devDependency; migrated the schema generator to ESM; regenerated OpenAPI TypeScript schemas — added two admin endpoints, new JobInfo/queue/lock models, many string-enum annotations, and switched several examples to array format. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer (npm)
participant Node as Node.js (ESM)
participant Script as generate-schemas.mjs
participant Dotenv as dotenv-flow
participant OpenAPI as openapi-typescript
participant FS as FileSystem
Dev->>Node: npm run schema (runs .mjs)
Node->>Script: load ES module
Script->>Dotenv: config(resolve(__dirname,'../')) %%[#88c0d0]%%
Script->>OpenAPI: spawn generator (exec)
OpenAPI-->>Script: return generated TypeScript
Script->>FS: write `webapp/src/service/*.generated.ts`
note right of FS: New admin endpoints, JobInfo/queue/lock models, many enum annotations, example format changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (2)webapp/src/service/billingApiSchema.generated.ts (1)
webapp/src/service/apiSchema.generated.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
webapp/src/service/apiSchema.generated.ts (1)
1346-1361
: Incorrect batch job type literalThe new enum literal is misspelled as
"PRE_TRANSLATE_BT_TM"
(missing theY
). Existing API responses and the rest of the schema still use"PRE_TRANSLATE_BY_TM"
, so this change breaks type safety and downstream code that references the real value. Please correct the literal before merging.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
webapp/package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (2)
webapp/package.json
(1 hunks)webapp/src/service/apiSchema.generated.ts
(80 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
webapp/src/service/apiSchema.generated.ts (1)
webapp/src/service/billingApiSchema.generated.ts (1)
components
(218-1464)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: BT 🔎 (ktlint:test)
- GitHub Check: BT 🔎 (data:test)
- GitHub Check: BT 🔎 (server-app:runStandardTests)
- GitHub Check: BT 🔎 (ee-test:test)
- GitHub Check: BT 🔎 (server-app:runWebsocketTests)
- GitHub Check: BT 🔎 (security:test)
- GitHub Check: BT 🔎 (server-app:runWithoutEeTests)
- GitHub Check: BT 🔎 (server-app:runContextRecreatingTests)
- GitHub Check: Build frontend 🏗️
- GitHub Check: Frontend static check 🪲
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
webapp/package.json
(2 hunks)webapp/scripts/generate-schemas.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
- GitHub Check: E2E testing 🔎 (15, 9)
- GitHub Check: E2E testing 🔎 (15, 14)
- GitHub Check: E2E testing 🔎 (15, 10)
- GitHub Check: E2E testing 🔎 (15, 13)
- GitHub Check: E2E testing 🔎 (15, 8)
- GitHub Check: E2E testing 🔎 (15, 12)
- GitHub Check: E2E testing 🔎 (15, 11)
- GitHub Check: E2E testing 🔎 (15, 7)
- GitHub Check: E2E testing 🔎 (15, 6)
- GitHub Check: E2E testing 🔎 (15, 3)
- GitHub Check: E2E testing 🔎 (15, 0)
- GitHub Check: E2E testing 🔎 (15, 4)
- GitHub Check: E2E testing 🔎 (15, 5)
- GitHub Check: E2E testing 🔎 (15, 1)
- GitHub Check: E2E testing 🔎 (15, 2)
- GitHub Check: BT 🔎 (ktlint:test)
- GitHub Check: BT 🔎 (security:test)
- GitHub Check: BT 🔎 (data:test)
- GitHub Check: BT 🔎 (server-app:runWithoutEeTests)
- GitHub Check: BT 🔎 (ee-test:test)
- GitHub Check: BT 🔎 (server-app:runWebsocketTests)
- GitHub Check: BT 🔎 (server-app:runStandardTests)
- GitHub Check: BT 🔎 (server-app:runContextRecreatingTests)
- GitHub Check: Frontend static check 🪲
🔇 Additional comments (4)
webapp/package.json (1)
72-73
: LGTM! Script migration to ESM.The update from
generate-schemas.cjs
togenerate-schemas.mjs
correctly addresses the ESM-only requirement of openapi-typescript v5. This resolves the previously flaggedERR_REQUIRE_ESM
concern.webapp/scripts/generate-schemas.mjs (3)
1-4
: LGTM! Clean ESM imports.The migration to ESM imports is correct:
- Using
node:
protocol for built-in modules (recommended practice)- Named imports for all dependencies
- Proper use of
import
statements replacingrequire
6-7
: LGTM! Correct __filename/__dirname reconstruction.The ESM equivalent of
__filename
and__dirname
is properly reconstructed usingfileURLToPath
anddirname
, which is the standard approach for ESM modules that need these Node.js CommonJS globals.
9-12
: LGTM! dotenv-flow configuration updated for ESM.The dotenv-flow configuration correctly:
- Uses named import of
config
function- Passes
path
option with proper resolution to parent directory- Maintains the
default_node_env
setting
8d9477f
to
cc11619
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
webapp/scripts/generate-schemas.mjs (1)
9-12
: Consider handling the config() return value.According to dotenv-flow v4.x behavior,
config()
returns an error when no appropriate .env files are found. While the script will continue without throwing, missing environment variables may cause issues downstream (e.g., whenVITE_APP_API_URL
is needed but not set).Apply this diff to add error handling:
-config({ +const result = config({ default_node_env: 'development', path: resolve(__dirname, '../'), }); + +if (result.error) { + console.warn('Warning: No .env files found. Using default values.'); +}Based on learnings.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
webapp/package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (3)
webapp/package.json
(2 hunks)webapp/scripts/generate-schemas.mjs
(1 hunks)webapp/src/service/apiSchema.generated.ts
(88 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- webapp/package.json
🔇 Additional comments (8)
webapp/scripts/generate-schemas.mjs (1)
1-7
: LGTM: ESM migration follows best practices.The migration to ESM is correctly implemented using standard patterns:
fileURLToPath(import.meta.url)
anddirname()
for __filename/__dirname- Node.js built-in modules with
node:
prefix- Named imports from dotenv-flow
This migration aligns with modern JavaScript practices and likely supports openapi-typescript v5's ESM requirements.
webapp/src/service/apiSchema.generated.ts (7)
49-52
: New admin endpoints added; ensure UI access control and usage are gated.Two administration endpoints were introduced:
- GET /v2/administration/batch-job-queue
- GET /v2/administration/project-batch-locks
Verify these are only used in admin-only surfaces and that navigation/feature flags respect RBAC.
Also applies to: 56-59
1351-1371
: Inconsistent batch job type string: BT vs BY.Enums include PRE_TRANSLATE_BT_TM in BatchJobModel/JobInfo, while activity uses BATCH_PRE_TRANSLATE_BY_TM. Likely a "BY" vs "BT" mismatch. If UI maps by string constants, this can break badges/icons or filters.
If this is a spec typo, please adjust the OpenAPI source and re-generate. I can open a follow-up issue if needed.
Also applies to: 3058-3087, 4427-4463
2232-2535
: Suspicious error code literal "tag_too_log".ErrorResponseTyped.code includes "tag_too_log". If downstream code expects "tag_too_long", this will cause mismatches.
3559-3592
: New LLM provider type "GOOGLE_AI" added.Ensure all switch/case and mapping logic for LLM providers handles GOOGLE_AI (icons, labels, form defaults).
1262-1266
: Auth provider enum adds SSO_GLOBAL.If UI branches on authType, make sure SSO_GLOBAL is supported or gracefully handled.
5032-5038
: S3 DTO includes contentStorageType?: "S3" | "AZURE".This union inside S3ContentStorageConfigDto looks generic but can confuse forms/validators keyed by DTO name. Confirm this is intentional from the spec (shared discriminator) and that client-side validation allows both where this DTO is used.
1-20
: Overall: schema regeneration looks good.Types export shape (paths, components, operations) remains consistent with prior versions; added JSDoc enums/examples are non-breaking. LGTM on the generated file.
If you rely on operations[...] type names directly, run a quick search to confirm no breakage:
Also applies to: 21080-21083
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have to regenerate also the billing schema
cc11619
to
505613d
Compare
505613d
to
989eddc
Compare
Regenerated
Wysyłane z aplikacji Outlook dla systemu iOS<https://aka.ms/o0ukef>
…________________________________
Od: Jan Cizmar ***@***.***>
Wysłane: Wednesday, October 15, 2025 7:28:15 AM
Do: tolgee/tolgee-platform ***@***.***>
DW: Kamil Dzieniszewski ***@***.***>; Author ***@***.***>
Temat: Re: [tolgee/tolgee-platform] feat: update openapi-typescript from v4.0.2 to v5.4.2 (PR #3264)
@JanCizmar requested changes on this pull request.
You'll have to regenerate also the billing schema
—
Reply to this email directly, view it on GitHub<#3264 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA23YWE553THD75XAD2GOMT3XXLO7AVCNFSM6AAAAACIGUUS42VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTGMZYGQYTGMBUGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
# [3.135.0](v3.134.0...v3.135.0) (2025-10-15) ### Features * update openapi-typescript from v4.0.2 to v5.4.2 ([#3264](#3264)) ([c68b109](c68b109))
Upgrade openapi-typescript to v5.4.2 to reduce
npm run schema
execution time by 66% and provide more accurate TypeScript types for API calls, improving autocomplete and catching API contract mismatches earlier.Key benefits for developers:
Faster iteration: Schema regeneration goes from ~400ms → ~135ms
Better IntelliSense: More accurate types for oneOf/anyOf means better autocomplete
Summary by CodeRabbit
New Features
Documentation
Chores