Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

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/project to @webiny/project-aws where Pulumi app types are defined.

Changes

  • New abstractions in project-aws with proper typing:

    • abstractions/features/pulumi/CorePulumi.ts - typed as ICorePulumi with CorePulumiApp vs. ICorePulumi<unknown>
    • abstractions/features/pulumi/ApiPulumi.ts - typed as IApiPulumi with ApiPulumiApp vs. IApiPulumi<unknown>
    • abstractions/features/pulumi/AdminPulumi.ts - typed as IAdminPulumi with AdminPulumiApp vs. IAdminPulumi<unknown>
    • pulumi/features/CorePulumi/CorePulumi.ts - implementation using typed abstraction
    • pulumi/features/ApiPulumi/ApiPulumi.ts - implementation using typed abstraction
    • pulumi/features/AdminPulumi/AdminPulumi.ts - implementation using typed abstraction
    • pulumi/extensions/CorePulumi.ts - extension definition
    • pulumi/extensions/ApiPulumi.ts - extension definition
    • pulumi/extensions/AdminPulumi.ts - extension definition
  • Updated Pulumi app creators:

    • createCorePulumiApp.ts - Import from local abstractions, improved cast: app as CorePulumiApp (was app as unknown as CorePulumiApp)
    • createApiPulumiApp.ts - Import from local abstractions, improved cast: app as ApiPulumiApp (was app as unknown as ApiPulumiApp)
    • createAdminPulumiApp.ts - Import from local abstractions, improved cast: app as AdminPulumiApp (was app as unknown as CorePulumiApp - also fixes bug)
  • Removed from project package:

    • All CorePulumi, ApiPulumi, and AdminPulumi abstractions, implementations, and extensions
    • Removed Pulumi extension handling from createProjectSdkContainer.ts (extension filtering and composite registration)
    • Updated extensions/index.ts to remove Pulumi extension exports and definitions
    • Removed all pulumi-related index files from abstractions and features
  • Updated exports:

    • project-aws/infra.ts - imports CorePulumi, ApiPulumi, and AdminPulumi locally
    • webiny/infra/features/CorePulumi.ts - re-exports from project-aws
    • webiny/infra/features/ApiPulumi.ts - re-exports from project-aws
    • webiny/infra/features/AdminPulumi.ts - re-exports from project-aws
// Before: Double-cast required due to ICorePulumi<unknown>
const handlers = sdk.getContainer().resolve(CorePulumi);
handlers.execute(app as unknown as CorePulumiApp);

// After: Single cast with proper type checking
const handlers = sdk.getContainer().resolve(CorePulumi); // ICorePulumi
handlers.execute(app as CorePulumiApp);

Note: 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 CorePulumiApp incorrectly; now properly casts to AdminPulumiApp.

Architectural Compliance: The @webiny/project package maintains no dependency on @webiny/project-aws and is completely unaware of Pulumi extensions. All Pulumi-related code now exists exclusively in @webiny/project-aws package where Pulumi app types are defined.

Follows pattern established by CoreStackOutputService, ApiStackOutputService, and AdminStackOutputService migrations.

Original prompt

we need to move #file:CorePulumi.ts and its impl from project to project-aws pkg. THIS IS B/C in there we actually have access to pulum apps.
if we had it there, we'd be able to actually properly type app: TApp.
We did the same previously with #file:CoreStackOutputService.ts #file:ApiStackOutputService.ts and #file:AdminStackOutputService.ts .
Note you'll need to revisit exports in #file:infra.ts

The user has attached the following files from their workspace:

  • packages/app-file-manager/src/hooks/useDeleteFile.tsx

TITLE: Move CorePulumi.ts from project to project-aws package for proper typing

USER INTENT: Relocate CorePulumi.ts and its implementation from the project package to the project-aws package to enable proper typing of app: TApp with access to Pulumi apps.

TASK DESCRIPTION: Move CorePulumi.ts from project to project-aws package, following the same pattern previously used for CoreStackOutputService.ts, ApiStackOutputService.ts, and AdminStackOutputService.ts. This migration is necessary because the project-aws package has access to Pulumi apps, allowing proper typing of the app: TApp parameter.

EXISTING:

  • Previously moved CoreStackOutputService.ts, ApiStackOutputService.ts, and AdminStackOutputService.ts from project to project-aws using this same pattern
  • CorePulumi.ts currently exists in the project package
  • Exports are defined in infra.ts

PENDING:

  • Move #file:CorePulumi.ts and its implementation from project to project-aws package
  • Update exports in #file:infra.ts to reflect the new location
  • Ensure proper typing of app: TApp is achieved with access to Pulumi apps in the new location

CODE STATE:

  • #file:CorePulumi.ts - Needs to be moved from project to project-aws
  • #file:infra.ts - Exports need to be updated after the move
  • #file:CoreStackOutputService.ts - Previously moved (reference pattern)
  • #file:ApiStackOutputService.ts - Previously moved (reference pattern)
  • #file:AdminStackOutputService.ts - Previously moved (reference pattern)

RELEVANT CODE/DOCUMENTATION SNIPPETS:
None provided in the conversation.

OTHER NOTES:
The primary motivation for this move is to gain access to Pulumi apps within the project-aws package, which will enable proper TypeScript typing for the app: TApp parameter. This follows an established pattern in the codebase for moving stack output services.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 2, 2026
Copilot AI and others added 2 commits January 2, 2026 16:18
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Copilot AI changed the title [WIP] Move CorePulumi.ts from project to project-aws package for proper typing Move CorePulumi to project-aws for proper app typing Jan 2, 2026
Copilot AI requested a review from adrians5j January 2, 2026 16:35

export const definitions = [
AwsTags.definition,
CorePulumi.definition,
Copy link
Member

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

Copy link
Contributor Author

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>
Copilot AI changed the title Move CorePulumi to project-aws for proper app typing Move CorePulumi, ApiPulumi, and AdminPulumi to project-aws for proper app typing Jan 2, 2026
Copilot AI requested a review from adrians5j January 2, 2026 16:44
Copy link
Member

@adrians5j adrians5j left a 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> {
Copy link
Member

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

Copy link
Contributor Author

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>
Copilot AI requested a review from adrians5j January 3, 2026 06:05
@Pavel910 Pavel910 added this to the 6.0.0 milestone Jan 5, 2026
@adrians5j
Copy link
Member

I don't want PulumiCore,PulumiAdmin,PulumiApi in project package. Only the ones in project-aws should remain, because those are tied to actual Pulumi apps. @copilot

Co-authored-by: adrians5j <5121148+adrians5j@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 5, 2026

I don't want PulumiCore,PulumiAdmin,PulumiApi in project package. Only the ones in project-aws should remain, because those are tied to actual Pulumi apps. @copilot

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
Copy link
Member

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

Copy link
Contributor Author

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>
Copilot AI requested a review from adrians5j January 6, 2026 04:36
@adrians5j adrians5j changed the title Move CorePulumi, ApiPulumi, and AdminPulumi to project-aws for proper app typing [🫥 ON HOLD] Move CorePulumi, ApiPulumi, and AdminPulumi to project-aws for proper app typing Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants