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

[HTML] example "usage" imports are syntactically incorrect #591

Open
nberlette opened this issue May 28, 2024 · 0 comments
Open

[HTML] example "usage" imports are syntactically incorrect #591

nberlette opened this issue May 28, 2024 · 0 comments

Comments

@nberlette
Copy link

The generated example usage code (for importing symbols from the modules) have been erroneous for quite a while now.

First off, none of the paths are incorrectly formatted, and always appear as just the filename without any relative ./ prefix or anything. For example, import { titleCase } from "title-case.ts";. Copy and paste that into the REPL and see how it goes.

It'd be great if there was a way for deno_doc to pick up on the JSR configuration in the deno.json file, and format imports accordingly. Like import { isString } from "jsr:@type/is/string"; (wishful thinking for the future). But in the mean time, I think at the very least it should be formatting relative paths properly.

Now, for default exports (as I mentioned in #590), the generated import seems to get really funky. The identifier it uses always ends up being... a single dot. Yup, when viewing a default export, the suggested usage code I get is import . from "capitalize.ts";.

For context, I run canary releases of Deno 99% of the time. I make sure to stay on top of upgrading to the latest build regularly (sometimes several times a day 😅). On the latest build, this erroroneous behavior is still persisting.

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

No branches or pull requests

1 participant