RoadieHQ / roadie-backstage-plugins

All Backstage plugins created by Roadie.
https://roadie.io
Apache License 2.0
281 stars 406 forks source link

Typescript errors with the latest Backstage 1.33.0 #1729

Open drodil opened 3 days ago

drodil commented 3 days ago

The following error is generated when running tsc with the latest backstage release:

error TS2345: Argument of type 'TemplateAction<{ path: string; content: string; preserveFormatting?: boolean | undefined; }, JsonObject>' is not assignable to parameter of type 'TemplateAction<any, any>'.
  Types of property 'handler' are incompatible.
    Type '(ctx: ActionContext<{ path: string; content: string; preserveFormatting?: boolean | undefined; }, JsonObject>) => Promise<void>' is not assignable to type '(ctx: ActionContext<any, any>) => Promise<void>'.
      Types of parameters 'ctx' and 'ctx' are incompatible.
        Type 'ActionContext<any, any>' is not assignable to type 'ActionContext<{ path: string; content: string; preserveFormatting?: boolean | undefined; }, JsonObject>'.
          Types of property 'checkpoint' are incompatible.
            Type '<T extends JsonValue | void>(opts: { key: string; fn: () => T | Promise<T>; }) => Promise<T>' is not assignable to type '<U extends JsonValue>(key: string, fn: () => Promise<U>) => Promise<U>'.
              Types of parameters 'opts' and 'key' are incompatible.
                Type 'string' is not assignable to type '{ key: string; fn: () => U | Promise<U>; }'.

33           createWriteFileAction(),
             ~~~~~~~~~~~~~~~~~~~~~~~

Expected Behavior

The @roadiehq/scaffolder-backend-module-utils should pass tsc

Current Behavior

See above

Steps to Reproduce

  1. Upgrade to Backstage 1.33.0
  2. Run tsc:full

Your Environment

cara52 commented 2 days ago

Currently experiencing the same error with createHttpBackstageAction()

Version: "scaffolder-backend-module-http-request": "^5.0.1"