pulumi / pulumi-cdk

Pulumi/CDK Interop Library
Apache License 2.0
62 stars 5 forks source link

Examples do not compile against latest master #175

Open t0yv0 opened 4 hours ago

t0yv0 commented 4 hours ago

What happened?

I think the recent change https://github.com/pulumi/pulumi-cdk/pull/167 is good but we need to have the examples in repo updated (that also serve as tests). Apparently the wrong code is being tested, not the release candidate but some older version.

Example

cd examples/ec2-instance
npm i ~/code/pulumi-cdk
pulumi preview
Diagnostics:
  pulumi:pulumi:Stack (pulumi-aws-cdk-ec2-instance-dev):
    error: Running program '/Users/anton/code/pulumi-cdk/examples/ec2-instance/' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    index.ts(10,9): error TS2554: Expected 2-3 arguments, but got 1.
    index.ts(21,33): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
      Type 'Ec2CdkStack' is not assignable to type 'Construct'.
        Types of property 'node' are incompatible.
          Type 'import("/Users/anton/code/pulumi-cdk/node_modules/constructs/lib/construct").Node' is not assignable to type 'import("/Users/anton/code/pulumi-cdk/examples/ec2-instance/node_modules/constructs/lib/construct").Node'.
            Types have separate declarations of a private property 'host'.
    index.ts(33,53): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(40,35): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(53,46): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(62,33): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(75,27): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(77,27): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(80,27): error TS2345: Argument of type 'this' is not assignable to parameter of type 'Construct'.
    index.ts(84,14): error TS2339: Property 'synth' does not exist on type 'Ec2CdkStack'.

Output of pulumi about

N/A

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

t0yv0 commented 4 hours ago

I was trying to debug this test locally to try to get at a repro case for #171 but run into this need a little help catching up.