Closed mohitb35 closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
planet-webapp-multi-tenancy-setup | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 16, 2024 10:49am |
The pull request introduces several updates across multiple files. The .gitignore
file has been enhanced to exclude additional configuration and environment files. A new task for TypeScript compilation checks has been added in the .vscode/tasks.json
. Minor modifications were made to a message key in the RedeemCode
component, and the unitTypeOptions
constant in the BasicDetails
component was updated to improve type safety using TypeScript's as const
assertion.
File Path | Change Summary |
---|---|
.gitignore |
Added entries for .vscode/settings.json , .vscode/launch.json , .env copy.local , and tsconfig.tsbuildinfo . |
.vscode/tasks.json |
Added a new task labeled "TypeScript: Check MessageKeys errors" for type checking with tsc . |
pages/sites/[slug]/[locale]/profile/redeem/[code].tsx |
Modified message key from t('redeem:selfGiftMessage') to t('selfGiftMessage') . |
src/features/user/ManageProjects/components/BasicDetails.tsx |
Changed unitTypeOptions declaration to use as const for enhanced type safety. |
sequenceDiagram
participant Developer
participant VSCode
participant TypeScript
Developer->>VSCode: Execute "TypeScript: Check MessageKeys errors"
VSCode->>TypeScript: Run `npx tsc --noEmit --pretty`
TypeScript-->>VSCode: Return type check results
VSCode-->>Developer: Display filtered output
🐇 In the garden of code, we hop and play,
With.gitignore
keeping clutter at bay.
A task for TypeScript, oh what a delight,
Errors caught swiftly, everything feels right!
With keys now simplified, our paths are clear,
Hopping through changes, we celebrate here! 🎉
.vscode/tasks.json (1)
`1-17`: **LGTM!** The TypeScript task configuration is well-defined and serves a useful purpose in the development workflow. It provides an efficient way to identify and address specific type errors related to `MessageKeys`. The task: - Correctly invokes the TypeScript compiler with appropriate flags - Filters the output to focus on the relevant error messages - Presents the results in a clear and accessible manner This task can help developers catch and fix type errors early in the development process, improving code quality and maintainability.
Those errors will be fixed separately. For now, we've fixed errors where the keys were known (more or less static).
In many of the other cases, the keys are dynamic and we need to update or set up types and type checks to handle them.
Plan to take them up when we focus on app maintenance for a bit
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Norbert Schuler @.> Sent: Monday, September 16, 2024 7:22:55 PM To: Plant-for-the-Planet-org/planet-webapp @.> Cc: Mohit Bajaj @.>; Author @.> Subject: Re: [Plant-for-the-Planet-org/planet-webapp] Add missing translations (PR #2231)
@norbertschuler commented on this pull request.
In .vscode/tasks.jsonhttps://github.com/Plant-for-the-Planet-org/planet-webapp/pull/2231#discussion_r1761207757:
@@ -0,0 +1,17 @@ +{
- // See https://go.microsoft.com/fwlink/?LinkId=733558
- // for the documentation about the tasks.json format
- "version": "2.0.0",
- "tasks": [
- {
- "type": "shell",
- "command": "npx tsc --noEmit --pretty | grep -A 1 \"is not assignable to parameter of type 'MessageKeys\"",
Running this task I get a lot of errors show like:
src/features/common/InputTypes/AutoCompleteCountry.tsx:69:23 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'MessageKeys<{ auto: string; ac: string; af: string; ax: string; al: string; dz: string; as: string; ad: string; ao: string; ai: string; aq: string; ag: string; ar: string; am: string; aw: string; au: string; at: string; az: string; ... 241 more ...; zw: string; }, "de" | ... 258 more ... | "zw">'.
So is the plan to fix them after merging this or within this PR?
— Reply to this email directly, view it on GitHubhttps://github.com/Plant-for-the-Planet-org/planet-webapp/pull/2231#pullrequestreview-2306743707, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKWWEYZPMHDSJWDWL4FBIBDZW3PDPAVCNFSM6AAAAABOI6LMJGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMBWG42DGNZQG4. You are receiving this because you authored the thread.Message ID: @.***>
unitTypeOptions
(src/features/user/ManageProjects/components/BasicDetails.tsx)