Skip to content
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

deno publish to jsr does not resolve @deno-types="..." #24076

Open
Milly opened this issue Jun 2, 2024 · 2 comments
Open

deno publish to jsr does not resolve @deno-types="..." #24076

Milly opened this issue Jun 2, 2024 · 2 comments
Labels
bug Something isn't working correctly publish Related to "deno publish" subcommand

Comments

@Milly
Copy link
Contributor

Milly commented Jun 2, 2024

Version: Deno 1.43.6

I published Project A to jsr, which internally references an npm library and DefinitelyTyped.

Definition of Project A:

// -- deno.jsonc
{
  // ...
  "imports": {
    "@sinonjs/fake-timers": "npm:@sinonjs/fake-timers@^11.2.2",
    "@types/sinonjs__fake-timers": "npm:@types/sinonjs__fake-timers@^8.1.5"
  }
}

// -- internal.ts
// @deno-types="@types/sinonjs__fake-timers"
import { install } from "@sinonjs/fake-timers";
// ...

When I referenced this from another Project B, deno check started failing with the following error:

error: Failed resolving types. Relative import path "@types/sinonjs__fake-timers" not prefixed with / or ./ or ../ and not in import map from "https://jsr.io/..."

The internal.ts file of Project A is published to jsr as follows:

// @deno-types="@types/sinonjs__fake-timers"
import { install } from "npm:@sinonjs/fake-timers@^11.2.2";

The import ... from "..." statements are rewritten according to imports in deno.jsonc. However, nothing is done for @deno-types="...".

@lucacasonato lucacasonato added bug Something isn't working correctly publish Related to "deno publish" subcommand labels Jun 3, 2024
@yazan-abdalrahman
Copy link
Contributor

@Milly
Hello, could you clarify how I may re-produce the issue?

@Milly
Copy link
Contributor Author

Milly commented Jun 12, 2024

@yazan-abdalrahman
Is there a way to get a dry-run result of the publish command?
I have no way to test it other than publishing a bunch of junk packages to jsr...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly publish Related to "deno publish" subcommand
Projects
None yet
Development

No branches or pull requests

3 participants