denoland / deployctl

Command line tool for Deno Deploy
https://deno.com/deploy
MIT License
352 stars 58 forks source link

deployctl does not work with Deno 2.0 RC version #328

Closed magurotuna closed 1 month ago

magurotuna commented 2 months ago

We get type errors when we run deployctl with Deno 2.0 RC version:

error: TS2339 [ERROR]: Property 'isatty' does not exist on type 'typeof Deno'.
      Deno.isatty(stream.rid) &&
           ~~~~~~
    at file:///Users/runner/work/deployctl/deployctl/vendor/deno.land/x/tty@0.1.4/is_interactive.ts:4:12

TS2339 [ERROR]: Property 'isatty' does not exist on type 'typeof Deno'.
  return Deno.isatty(stream.rid);
              ~~~~~~
    at file:///Users/runner/work/deployctl/deployctl/vendor/deno.land/x/tty@0.1.4/is_interactive.ts:9:15

TS2339 [ERROR]: Property 'isatty' does not exist on type 'typeof Deno'.
  return Deno.isatty(stream.rid);
              ~~~~~~
    at file:///Users/runner/work/deployctl/deployctl/vendor/deno.land/x/tty@0.1.4/is_interactive.ts:13:15

Found 3 errors.

https://github.com/denoland/deployctl/actions/runs/10715041741/job/29709772144?pr=313#step:8:205

bartlomieju commented 2 months ago

You can just @ts-ignore these APIs, they are still there but they are "soft-deprecated".

magurotuna commented 2 months ago

Thanks for the info, that should be a good fix for the moment, but we will need to move away from these deprecated APIs eventually, so I'm going to try to explore if the migration of deployctl to Deno 2.0 is easy

bartlomieju commented 2 months ago

Sounds good - I bet these stream are Deno.stdout or Deno.stderr which now have isTerminal() method that does the same thing.

magurotuna commented 2 months ago

It's actually a bit more complicated than it looks, because the use of the deprecated API is inside the dependency of dependency, which effectively is beyond our control - I think it's the best timing now to upgrade our dependencies as a whole. At first glance we can utilize stable version of std to achieve the same functionality. I'm checking it right now.

lucacasonato commented 2 months ago

https://github.com/denoland/deno/issues/25456