-
Notifications
You must be signed in to change notification settings - Fork 659
[🫥 ON HOLD] Move CorePulumi, ApiPulumi, and AdminPulumi to project-aws for proper app typing #4839
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
base: next
Are you sure you want to change the base?
Conversation
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
|
|
||
| export const definitions = [ | ||
| AwsTags.definition, | ||
| CorePulumi.definition, |
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.
We need also ApiPulumi and AdminPulumi @copilot
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.
Done! Added ApiPulumi and AdminPulumi following the same pattern as CorePulumi. Also fixed a bug in createAdminPulumiApp where it was incorrectly casting to CorePulumiApp instead of AdminPulumiApp. (9abd5b7)
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
adrians5j
left a 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.
| import { createAbstraction } from "@webiny/project/abstractions/createAbstraction.js"; | ||
| import type { AdminPulumiApp } from "~/pulumi/apps/admin/index.js"; | ||
|
|
||
| export interface IAdminPulumi<TApp = AdminPulumiApp> { |
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.
No need for generic TApp here. We can set AdminPulumiApp directly. Same goes for other apps
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.
Removed the generic TApp parameter from all three interfaces. Now using concrete types directly: IAdminPulumi, IApiPulumi, and ICorePulumi. (7be9cb2)
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
…mi-to-project-aws
|
I don't want PulumiCore,PulumiAdmin,PulumiApi in |
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Removed all CorePulumi, ApiPulumi, and AdminPulumi files from the project package. The SDK container now imports the composites and extension types from project-aws. (3a362c6) |
| import { | ||
| AdminPulumi as AdminPulumiExt, | ||
| ApiPulumi as ApiPulumiExt, | ||
| CorePulumi as CorePulumiExt |
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.
This is wrong. project pkg must not depend on project-aws.
Let's simply say that project pkg does not know about core/api/adminPulumi exts / impls / abses. @copilot
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.
Removed the project-aws dependency from project package. The project package no longer imports or knows about CorePulumi, ApiPulumi, and AdminPulumi extensions, implementations, or abstractions. (b39560b)
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
CorePulumi, ApiPulumi, and AdminPulumi abstractions lacked access to their respective app types, requiring unsafe double-casts. Moved all three Pulumi abstractions, implementations, and extensions from
@webiny/projectto@webiny/project-awswhere Pulumi app types are defined.Changes
New abstractions in project-aws with proper typing:
abstractions/features/pulumi/CorePulumi.ts- typed asICorePulumiwithCorePulumiAppvs.ICorePulumi<unknown>abstractions/features/pulumi/ApiPulumi.ts- typed asIApiPulumiwithApiPulumiAppvs.IApiPulumi<unknown>abstractions/features/pulumi/AdminPulumi.ts- typed asIAdminPulumiwithAdminPulumiAppvs.IAdminPulumi<unknown>pulumi/features/CorePulumi/CorePulumi.ts- implementation using typed abstractionpulumi/features/ApiPulumi/ApiPulumi.ts- implementation using typed abstractionpulumi/features/AdminPulumi/AdminPulumi.ts- implementation using typed abstractionpulumi/extensions/CorePulumi.ts- extension definitionpulumi/extensions/ApiPulumi.ts- extension definitionpulumi/extensions/AdminPulumi.ts- extension definitionUpdated Pulumi app creators:
createCorePulumiApp.ts- Import from local abstractions, improved cast:app as CorePulumiApp(wasapp as unknown as CorePulumiApp)createApiPulumiApp.ts- Import from local abstractions, improved cast:app as ApiPulumiApp(wasapp as unknown as ApiPulumiApp)createAdminPulumiApp.ts- Import from local abstractions, improved cast:app as AdminPulumiApp(wasapp as unknown as CorePulumiApp- also fixes bug)Removed from project package:
createProjectSdkContainer.ts(extension filtering and composite registration)extensions/index.tsto remove Pulumi extension exports and definitionsUpdated exports:
project-aws/infra.ts- imports CorePulumi, ApiPulumi, and AdminPulumi locallywebiny/infra/features/CorePulumi.ts- re-exports from project-awswebiny/infra/features/ApiPulumi.ts- re-exports from project-awswebiny/infra/features/AdminPulumi.ts- re-exports from project-awsNote: All interfaces use concrete types directly (e.g.,
ICorePulumi,IApiPulumi,IAdminPulumi) without generic type parameters for simplicity and clarity.Bug Fix: AdminPulumi previously cast to
CorePulumiAppincorrectly; now properly casts toAdminPulumiApp.Architectural Compliance: The
@webiny/projectpackage maintains no dependency on@webiny/project-awsand is completely unaware of Pulumi extensions. All Pulumi-related code now exists exclusively in@webiny/project-awspackage where Pulumi app types are defined.Follows pattern established by CoreStackOutputService, ApiStackOutputService, and AdminStackOutputService migrations.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.